/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('cms', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AlertEvent {
  alertName?: string(name='AlertName'),
  alertStatus?: string(name='AlertStatus'),
  arn?: string(name='Arn'),
  content?: string(name='Content'),
  customLabels?: map[string]any(name='CustomLabels'),
  deDupId?: string(name='DeDupId'),
  details?: string(name='Details'),
  eventName?: string(name='EventName'),
  eventType?: string(name='EventType'),
  expression?: string(name='Expression'),
  metrics?: [ 
    {
      curValue?: string(name='CurValue'),
      metricName?: string(name='MetricName'),
      metricNameEn?: string(name='MetricNameEn'),
      metricNameZh?: string(name='MetricNameZh'),
      operator?: string(name='Operator'),
      statistics?: string(name='Statistics'),
      threshold?: string(name='Threshold'),
      unit?: string(name='Unit'),
      unitFactor?: float(name='UnitFactor'),
    }
  ](name='Metrics'),
  product?: string(name='Product'),
  resourceInfo?: map[string]any(name='ResourceInfo'),
  ruleName?: string(name='RuleName'),
  severity?: string(name='Severity'),
  source?: string(name='Source'),
  summary?: string(name='Summary'),
  timestamp?: long(name='Timestamp'),
  traceId?: string(name='TraceId'),
  userId?: string(name='UserId'),
}

model AlertStrategyRelation {
  alertName?: string(name='AlertName'),
  strategyUuid?: string(name='StrategyUuid'),
}

model Dimension {
  label?: string(name='Label'),
  value?: string(name='Value'),
}

model EscalationRule {
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  escalations?: [ 
    {
      backupContactGroups?: [ string ](name='BackupContactGroups'),
      contactGroups?: [ string ](name='ContactGroups'),
      contactGroupsByLevel?: {
        critical?: [ string ](name='Critical'),
        error?: [ string ](name='Error'),
        info?: [ string ](name='Info'),
        resolve?: [ string ](name='Resolve'),
        warning?: [ string ](name='Warning'),
      }(name='ContactGroupsByLevel'),
      escalateMin?: long(name='EscalateMin'),
    }
  ](name='Escalations', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  updateTime?: string(name='UpdateTime'),
  userId?: string(name='UserId'),
  uuid?: string(name='Uuid'),
}

model Incident {
  actionTime?: long(name='ActionTime'),
  alertCount?: long(name='AlertCount'),
  endTime?: long(name='EndTime'),
  groupingData?: map[string]any(name='GroupingData'),
  groupingId?: string(name='GroupingId'),
  groupingKey?: string(name='GroupingKey'),
  incidentId?: string(name='IncidentId'),
  incidentStatus?: string(name='IncidentStatus'),
  severity?: string(name='Severity'),
  startTime?: long(name='StartTime'),
  strategyUuid?: string(name='StrategyUuid'),
  userId?: string(name='UserId'),
}

model Matcher {
  label?: string(name='Label'),
  operator?: string(name='Operator'),
  value?: string(name='Value'),
}

model MetricStat {
  associated?: map[string]string(name='Associated'),
  dimensions?: [
    Dimension
  ](name='Dimensions'),
  logTime?: long(name='LogTime'),
  measurements?: map[string]any(name='Measurements'),
  metric?: string(name='Metric'),
  namespace?: string(name='Namespace'),
  period?: int32(name='Period'),
  timestamp?: long(name='Timestamp'),
}

model MigrationJob {
  createTime?: string(name='CreateTime'),
  detail?: string(name='Detail'),
  jobStatus?: string(name='JobStatus'),
  plan?: {
    contacts?: [ 
      {
        channels?: [ 
          {
            level?: long(name='Level'),
            type?: string(name='Type'),
            value?: string(name='Value'),
          }
        ](name='Channels'),
        name?: string(name='Name'),
      }
    ](name='Contacts'),
    escalations?: [ 
      {
        escalations?: [ 
          {
            groups?: [ string ](name='Groups'),
            levelGroups?: {
              critical?: [ string ](name='Critical'),
              info?: [ string ](name='Info'),
              resolved?: [ string ](name='Resolved'),
              warning?: [ string ](name='Warning'),
            }(name='LevelGroups'),
          }
        ](name='Escalations'),
        name?: string(name='Name'),
        uuid?: string(name='Uuid'),
      }
    ](name='Escalations'),
    groups?: [ 
      {
        contacts?: [ string ](name='Contacts'),
        name?: string(name='Name'),
      }
    ](name='Groups'),
    ruleNames?: [ string ](name='RuleNames'),
    strategies?: [ 
      {
        escalationSetting?: {
          escalationUuid?: string(name='escalationUuid'),
        }(name='EscalationSetting'),
        name?: string(name='Name'),
        pushingSetting?: {
          targetUuids?: [ string ](name='TargetUuids'),
        }(name='PushingSetting'),
      }
    ](name='Strategies'),
    subscriptions?: [ 
      {
        conditions?: [ 
          {
            field?: string(name='Field'),
            op?: string(name='Op'),
            value?: string(name='Value'),
          }
        ](name='Conditions'),
        name?: string(name='Name'),
        strategyUuid?: string(name='StrategyUuid'),
      }
    ](name='Subscriptions'),
    targets?: [ 
      {
        arn?: string(name='Arn'),
        httpRequestTarget?: {
          contentType?: string(name='ContentType'),
          method?: string(name='Method'),
          url?: string(name='Url'),
        }(name='HttpRequestTarget'),
        name?: string(name='Name'),
        type?: string(name='Type'),
        uuid?: string(name='Uuid'),
      }
    ](name='Targets'),
  }(name='Plan'),
  ruleNames?: [ string ](name='RuleNames'),
  source?: [ 
    {
      rule?: {
        keywordFilter?: {
          keywords?: [ string ](name='Keywords'),
          relation?: string(name='Relation'),
        }(name='KeywordFilter'),
        name?: string(name='Name'),
        primaryFilters?: [ 
          {
            field?: string(name='Field'),
            opType?: string(name='OpType'),
            value?: string(name='Value'),
          }
        ](name='PrimaryFilters'),
      }(name='Rule'),
      targets?: [ 
        {
          content?: {
            group?: string(name='Group'),
            level?: string(name='Level'),
            method?: string(name='Method'),
            region?: string(name='Region'),
            resourcePath?: string(name='ResourcePath'),
            url?: string(name='Url'),
          }(name='Content'),
          type?: string(name='Type'),
        }
      ](name='Targets'),
    }
  ](name='Source'),
  updateTime?: string(name='UpdateTime'),
  uuid?: string(name='Uuid'),
}

model NotificationStrategy {
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  escalationSetting?: {
    autoResolveMin?: long(name='AutoResolveMin'),
    customChannels?: [ 
      {
        channelType?: string(name='ChannelType', description='This parameter is required.'),
        severities?: [ string ](name='Severities'),
        templateUuid?: string(name='TemplateUuid'),
      }
    ](name='CustomChannels'),
    escalationLevel?: string(name='EscalationLevel'),
    escalationUuid?: string(name='EscalationUuid'),
    range?: string(name='Range'),
    retriggerMin?: long(name='RetriggerMin'),
  }(name='EscalationSetting'),
  filterSetting?: {
    blackList?: [[ 
      {
        field?: string(name='Field', description='This parameter is required.'),
        op?: string(name='Op', description='This parameter is required.'),
        value?: string(name='Value', description='This parameter is required.'),
      }
    ]    ](name='BlackList'),
    whiteList?: [[ 
      {
        field?: string(name='Field', description='This parameter is required.'),
        op?: string(name='Op', description='This parameter is required.'),
        value?: string(name='Value', description='This parameter is required.'),
      }
    ]    ](name='WhiteList'),
  }(name='FilterSetting'),
  groupingSetting?: {
    enableRawAlertDispatching?: boolean(name='EnableRawAlertDispatching'),
    groupingItems?: [ 
      {
        keys?: [ string ](name='Keys'),
        type?: string(name='Type'),
      }
    ](name='GroupingItems'),
    periodMin?: int32(name='PeriodMin'),
    silenceSec?: int32(name='SilenceSec'),
    times?: int32(name='Times'),
  }(name='GroupingSetting'),
  name?: string(name='Name', description='This parameter is required.'),
  product?: string(name='Product'),
  pushingSetting?: {
    pushingDataFormat?: string(name='PushingDataFormat'),
    range?: string(name='Range'),
    targetUuids?: [ string ](name='TargetUuids'),
    templateUuid?: string(name='TemplateUuid'),
  }(name='PushingSetting'),
  routeSetting?: {
    routes?: [ 
      {
        conditions?: [ 
          {
            field?: string(name='Field'),
            op?: string(name='Op'),
            value?: string(name='Value'),
          }
        ](name='Conditions'),
        escalationUuid?: string(name='EscalationUuid'),
      }
    ](name='Routes'),
  }(name='RouteSetting'),
  updateTime?: string(name='UpdateTime'),
  userId?: string(name='UserId'),
  uuid?: string(name='Uuid'),
}

model NotificationTemplate {
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  enContent?: string(name='EnContent', example='Alarm $.alertName'),
  enItemContent?: string(name='EnItemContent', example='Alarm $.alertName'),
  enTitle?: string(name='EnTitle', example='Alarm $.alertName'),
  name?: string(name='Name', description='This parameter is required.'),
  type?: string(name='Type', example='DATA,  SMS,  ONCALL,  MAIL,  DING,  WEIXIN,  FEISHU,  SLACK'),
  updateTime?: string(name='UpdateTime'),
  userId?: string(name='UserId'),
  uuid?: string(name='Uuid'),
  wraperType?: string(name='WraperType', example='TEXT, MARKDOWN,CARD'),
  zhContent?: string(name='ZhContent', example='报警 $.alertName'),
  zhItemContent?: string(name='ZhItemContent', example='报警 $.alertName'),
  zhTitle?: string(name='ZhTitle', example='报警通知 $.alertName'),
}

model PushingTarget {
  arn?: string(name='Arn'),
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  httpRequestTarget?: {
    contentType?: string(name='ContentType'),
    encryptString?: string(name='EncryptString'),
    headers?: [ 
      {
        key?: string(name='Key'),
        value?: string(name='Value'),
      }
    ](name='Headers'),
    method?: string(name='Method'),
    url?: string(name='Url'),
  }(name='HttpRequestTarget'),
  name?: string(name='Name', description='This parameter is required.'),
  range?: string(name='Range'),
  templateUuid?: string(name='TemplateUuid'),
  type?: string(name='Type'),
  updateTime?: string(name='UpdateTime'),
  userId?: string(name='UserId'),
  uuid?: string(name='Uuid'),
}

model Subscription {
  conditions?: [ 
    {
      field?: string(name='Field'),
      operator?: string(name='Operator'),
      value?: string(name='Value'),
    }
  ](name='Conditions'),
  createTime?: string(name='CreateTime'),
  description?: string(name='Description'),
  enabled?: boolean(name='Enabled'),
  name?: string(name='Name', description='This parameter is required.'),
  product?: string(name='Product'),
  relation?: string(name='Relation'),
  strategyUuid?: string(name='StrategyUuid'),
  updateTime?: string(name='UpdateTime'),
  uuid?: string(name='Uuid'),
}

model AddTagsRequest {
  groupIds?: [ string ](name='GroupIds', description='The ID of the application group.

Valid values of N: 1 to 20.

For more information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

This parameter is required.', example='7301****'),
  regionId?: string(name='RegionId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

Valid values of N: 1 to 3. A tag key can be 1 to 64 characters in length.

You can create a tag key or specify an existing tag key. For more information about how to obtain a tag key, see [DescribeTagKeyList](https://help.aliyun.com/document_detail/145558.html).

>  The tag key cannot start with `aliyun` or `acs:`. The tag key (`Tag.N.Key`) and tag value (`Tag.N.Value`) must be specified at the same time.

This parameter is required.', example='key1'),
      value?: string(name='Value', description='The tag value.

Valid values of N: 1 to 3. A tag value can be 1 to 64 characters in length.

You can create a tag value or specify an existing tag value. For more information about how to obtain a tag value, see [DescribeTagValueList](https://help.aliyun.com/document_detail/145557.html).

>  The tag value cannot start with `aliyun` or `acs:`. The tag key (`Tag.N.Key`) and tag value (`Tag.N.Value`) must be specified at the same time.

This parameter is required.', example='value1'),
    }
  ](name='Tag', description='The tags.

This parameter is required.'),
}

model AddTagsResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='DAE4B115-3847-5438-8709-423627F0A3A3'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model AddTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddTagsResponseBody(name='body'),
}

/**
 * @summary Adds tags to an application group.
 *
 * @description This topic provides an example on how to add a tag to an application group whose ID is `7301****`. In this example, the key of the tag is `key1` and the value of the tag is `value1`.
 *
 * @param request AddTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddTagsResponse
 */
async function addTagsWithOptions(request: AddTagsRequest, runtime: Util.RuntimeOptions): AddTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddTags',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds tags to an application group.
 *
 * @description This topic provides an example on how to add a tag to an application group whose ID is `7301****`. In this example, the key of the tag is `key1` and the value of the tag is `value1`.
 *
 * @param request AddTagsRequest
 * @return AddTagsResponse
 */
async function addTags(request: AddTagsRequest): AddTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return addTagsWithOptions(request, runtime);
}

model ApplyMetricRuleTemplateRequest {
  appendMode?: string(name='AppendMode', description='The template application policy. Valid values:

*   all (default): deletes all the rules that are created by using the alert template from the selected application group, and then creates alert rules based on the template.
*   append: deletes the rules that are created by using the alert template from the selected application group, and then creates alert rules based on the existing template.', example='all'),
  applyMode?: string(name='ApplyMode', description='The mode in which the alert template is applied. Valid values:

*   GROUP_INSTANCE_FIRST: The metrics in the application group take precedence. If a metric specified in the alert template does not exist in the application group, the system does not generate an alert rule for the metric based on the alert template.
*   ALARM_TEMPLATE_FIRST: The metrics specified in the alert template take precedence. If a metric specified in the alert template does not exist in the application group, the system still generates an alert rule for the metric based on the alert template.', example='GROUP_INSTANCE_FIRST'),
  enableEndTime?: long(name='EnableEndTime', description='The end of the time period during which the alert rule is effective. Valid values: 00 to 23. A value of 00 indicates 00:59 and a value of 23 indicates 23:59.', example='23'),
  enableStartTime?: long(name='EnableStartTime', description='The beginning of the time period during which the alert rule is effective. Valid values: 00 to 23. A value of 00 indicates 00:00 and a value of 23 indicates 23:00.', example='00'),
  groupId?: long(name='GroupId', description='The ID of the application group to which the alert template is applied.

For more information about how to query the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

This parameter is required.', example='123456'),
  notifyLevel?: long(name='NotifyLevel', description='The alert notification method. Valid values:

Set the value to 4. A value of 4 indicates that alert notifications are sent by using TradeManager and DingTalk chatbots.', example='4'),
  silenceTime?: long(name='SilenceTime', description='The mute period during which notifications are not repeatedly sent for an alert. Unit: seconds. Default value: 86400.

>  Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.', example='86400'),
  templateIds?: string(name='TemplateIds', description='The ID of the alert template.

For more information about how to query the IDs of alert templates, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).

This parameter is required.', example='700****'),
  webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='https://www.aliyun.com'),
}

model ApplyMetricRuleTemplateResponseBody = {
  code?: int32(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3F897F3C-020A-4993-95B4-63ABB84F83E6'),
  resource?: {
    alertResults?: [ 
      {
        code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
        message?: string(name='Message', description='The returned message.', example='alert rule is creating, please wait a few minutes.'),
        ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08****'),
        ruleName?: string(name='RuleName', description='The name of the alert rule.', example='test123'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
      }
    ](name='AlertResults', description='The details of the generated alert rule.'),
    groupId?: long(name='GroupId', description='The ID of the application group.', example='123456'),
  }(name='Resource', description='The resources that are affected by the alert rule.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ApplyMetricRuleTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyMetricRuleTemplateResponseBody(name='body'),
}

/**
 * @summary Applies an alert template to an application group to generate an alert rule.
 *
 * @description In this example, the `700****` alert template is applied to the `123456` application group. For the generated alert rule, the ID is `applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08****`, and the name is `test123`.
 *
 * @param request ApplyMetricRuleTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyMetricRuleTemplateResponse
 */
async function applyMetricRuleTemplateWithOptions(request: ApplyMetricRuleTemplateRequest, runtime: Util.RuntimeOptions): ApplyMetricRuleTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appendMode)) {
    query['AppendMode'] = request.appendMode;
  }
  if (!Util.isUnset(request.applyMode)) {
    query['ApplyMode'] = request.applyMode;
  }
  if (!Util.isUnset(request.enableEndTime)) {
    query['EnableEndTime'] = request.enableEndTime;
  }
  if (!Util.isUnset(request.enableStartTime)) {
    query['EnableStartTime'] = request.enableStartTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.notifyLevel)) {
    query['NotifyLevel'] = request.notifyLevel;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.templateIds)) {
    query['TemplateIds'] = request.templateIds;
  }
  if (!Util.isUnset(request.webhook)) {
    query['Webhook'] = request.webhook;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyMetricRuleTemplate',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Applies an alert template to an application group to generate an alert rule.
 *
 * @description In this example, the `700****` alert template is applied to the `123456` application group. For the generated alert rule, the ID is `applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08****`, and the name is `test123`.
 *
 * @param request ApplyMetricRuleTemplateRequest
 * @return ApplyMetricRuleTemplateResponse
 */
async function applyMetricRuleTemplate(request: ApplyMetricRuleTemplateRequest): ApplyMetricRuleTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyMetricRuleTemplateWithOptions(request, runtime);
}

model BatchCreateInstantSiteMonitorRequest {
  regionId?: string(name='RegionId'),
  taskList?: [ 
    {
      address?: string(name='Address', description='The URL or IP address that is monitored by the task.

>  You must create at least one site monitoring task. You must specify all of the `Address`, `TaskName`, and `TaskType` parameters in each request.', example='https://www.aliyun.com'),
      ispCities?: string(name='IspCities', description='The detection points. If you leave this parameter empty, the system randomly selects three detection points.

The value is a `JSON array`. Example: `{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}`. The values of the city field indicate Beijing, Hangzhou, and Qingdao.

For information about how to obtain detection points, see [DescribeSiteMonitorISPCityList](https://help.aliyun.com/document_detail/115045.html).', example='[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]'),
      optionsJson?: string(name='OptionsJson', description='The extended options of the protocol that is used by the site monitoring task. The options vary based on the protocol.', example='{"time_out":5000}'),
      taskName?: string(name='TaskName', description='The name of the site monitoring task.

The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_).

>  You must create at least one site monitoring task. You must specify all of the `Address`, `TaskName`, and `TaskType` parameters in each request.', example='HangZhou_ECS1'),
      taskType?: string(name='TaskType', description='The type of the site monitoring task.

Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.

>  You must create at least one site monitoring task. You must specify all of the `Address`, `TaskName`, and `TaskType` parameters in each request.', example='HTTP'),
    }
  ](name='TaskList', description='The site monitoring tasks.

>  You must create at least one site monitoring task. You must specify all of the `Address`, `TaskName`, and `TaskType` parameters in each request.

This parameter is required.'),
}

model BatchCreateInstantSiteMonitorResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: [ 
    {
      taskId?: string(name='TaskId', description='The ID of the site monitoring task.', example='679fbe4f-b80b-4706-91b2-5427b43e****'),
      taskName?: string(name='TaskName', description='The name of the site monitoring task.', example='HangZhou_ECS1'),
    }
  ](name='Data', description='The information about the site monitoring task.', example='[{"taskName": "HangZhou_ECS1", "taskId": "679fbe4f-b80b-4706-91b2-5427b43e****"}]'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='7AE72720-2C96-5446-9F2B-308C7CEDFF1A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model BatchCreateInstantSiteMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchCreateInstantSiteMonitorResponseBody(name='body'),
}

/**
 * @summary Creates site monitoring tasks.
 *
 * @description This topic provides an example on how to create a site monitoring task named `HangZhou_ECS1`. The URL that is monitored by the task is `https://www.aliyun.com` and the type of the task is `HTTP`. The returned result shows that the site monitoring task is created. The name of the site monitoring task is `HangZhou_ECS1` and the task ID is `679fbe4f-b80b-4706-91b2-5427b43e****`.
 *
 * @param request BatchCreateInstantSiteMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchCreateInstantSiteMonitorResponse
 */
async function batchCreateInstantSiteMonitorWithOptions(request: BatchCreateInstantSiteMonitorRequest, runtime: Util.RuntimeOptions): BatchCreateInstantSiteMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskList)) {
    query['TaskList'] = request.taskList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchCreateInstantSiteMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates site monitoring tasks.
 *
 * @description This topic provides an example on how to create a site monitoring task named `HangZhou_ECS1`. The URL that is monitored by the task is `https://www.aliyun.com` and the type of the task is `HTTP`. The returned result shows that the site monitoring task is created. The name of the site monitoring task is `HangZhou_ECS1` and the task ID is `679fbe4f-b80b-4706-91b2-5427b43e****`.
 *
 * @param request BatchCreateInstantSiteMonitorRequest
 * @return BatchCreateInstantSiteMonitorResponse
 */
async function batchCreateInstantSiteMonitor(request: BatchCreateInstantSiteMonitorRequest): BatchCreateInstantSiteMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchCreateInstantSiteMonitorWithOptions(request, runtime);
}

model BatchExportRequest {
  cursor?: string(name='Cursor', description='When you call this operation to export data, you must specify the `Cursor` parameter. You can obtain the value of the `Cursor` parameter by using one of the following methods:

*   When you call this operation for the first time, you must call the Cursor operation to obtain the `Cursor` value. For more information, see [Cursor](https://help.aliyun.com/document_detail/2330730.html).
*   When you call this operation again, you can obtain the `Cursor` value from the returned data of the last call.

This parameter is required.', example='eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0MzIwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQ3NTY2MzYzMjY3NmI2ZjM5MzU2YjY4MzAzMTYyNzg3MTcwNjkzMTM3MjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2****'),
  length?: int32(name='Length', description='The maximum number of data entries that can be returned in each response.

Valid values: 1 to 10000.

This parameter is required.', example='1000'),
  measurements?: [ string ](name='Measurements', description='The statistical methods used to customize the returned data. By default, the measurements based on all statistical methods are returned.

For example, the `cpu_idle` metric of ECS (`acs_ecs_dashboard`) has three statistical methods: `Average`, `Maximum`, and `Minimum`. If you want to return only the measurements based on the `Average` and `Maximum` statistical methods, set this parameter to `["Average", "Maximum"]`.

The statistical methods of metrics are displayed in the `Statistics` column on the Metrics page of each cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).'),
  metric?: string(name='Metric', description='The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  The value of this parameter must be the same as the value of the request parameter `Metric` in the Cursor operation.

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  The value of this parameter must be the same as the value of the request parameter `Namespace` in the Cursor operation.

This parameter is required.', example='acs_ecs_dashboard'),
}

model BatchExportShrinkRequest {
  cursor?: string(name='Cursor', description='When you call this operation to export data, you must specify the `Cursor` parameter. You can obtain the value of the `Cursor` parameter by using one of the following methods:

*   When you call this operation for the first time, you must call the Cursor operation to obtain the `Cursor` value. For more information, see [Cursor](https://help.aliyun.com/document_detail/2330730.html).
*   When you call this operation again, you can obtain the `Cursor` value from the returned data of the last call.

This parameter is required.', example='eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0MzIwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQ3NTY2MzYzMjY3NmI2ZjM5MzU2YjY4MzAzMTYyNzg3MTcwNjkzMTM3MjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTQ3OTU4MjMsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDE5NTgyMywic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2****'),
  length?: int32(name='Length', description='The maximum number of data entries that can be returned in each response.

Valid values: 1 to 10000.

This parameter is required.', example='1000'),
  measurementsShrink?: string(name='Measurements', description='The statistical methods used to customize the returned data. By default, the measurements based on all statistical methods are returned.

For example, the `cpu_idle` metric of ECS (`acs_ecs_dashboard`) has three statistical methods: `Average`, `Maximum`, and `Minimum`. If you want to return only the measurements based on the `Average` and `Maximum` statistical methods, set this parameter to `["Average", "Maximum"]`.

The statistical methods of metrics are displayed in the `Statistics` column on the Metrics page of each cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).'),
  metric?: string(name='Metric', description='The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  The value of this parameter must be the same as the value of the request parameter `Metric` in the Cursor operation.

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  The value of this parameter must be the same as the value of the request parameter `Namespace` in the Cursor operation.

This parameter is required.', example='acs_ecs_dashboard'),
}

model BatchExportResponseBody = {
  anchor?: long(name='Anchor', description='The timestamp of the data requested by the backend. A larger timestamp indicates that the data export time is closer to the current time.', example='1678781819000'),
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  cursor?: string(name='Cursor', description='The Cursor information that is used to call this operation again.

>  If `null` is returned, the monitoring data is exported.', example='v2.5eyJidWNrZXRzIjo0LCJjdXJzb3IiOiIxNjQxNDU0ODAwMDAwMWUxY2YxNWY0NTU0MTliZjllYTY4OWQ2ODI1OTU1Yzc1NmZjMDQ2OTMxMzczMzM2MzUzMTMxMzEzMzM0MzMzODM5MzEzMTMwMjQyYzY5MmQzMjdhNjU2MjY3N2E2NjZhNzczOTY2NmM3Mjc0NjM3MzY5Njg3NDcyMjQyYyIsImN1cnNvclZlcnNpb24iOiJxdWVyeSIsImVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydEVuZFRpbWUiOjE2NDE0NTUyMzYxMTIsImV4cG9ydFN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwiZXhwcmVzc1JhbmdlIjpmYWxzZSwiaGFzTmV4dCI6dHJ1ZSwiaW5wdXRNZXRyaWMiOiJDUFVVdGlsaXphdGlvbiIsImlucHV0TmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJsaW1pdCI6MTAwMCwibG9nVGltZU1vZGUiOnRydWUsIm1hdGNoZXJzIjp7ImNoYWluIjpbeyJsYWJlbCI6InVzZXJJZCIsIm9wZXJhdG9yIjoiRVFVQUxTIiwidmFsdWUiOiIxNzM2NTExMTM0Mzg5MTEwIn1dfSwibWV0cmljIjoiQ1BVVXRpbGl6YXRpb24iLCJtZXRyaWNUeXBlIjoiTUVUUklDIiwibmFtZXNwYWNlIjoiYWNzX2Vjc19kYXNoYm9hcmQiLCJuZXh0UGtBZGFwdGVyIjp7fSwib2Zmc2V0IjowLCJwYXJlbnRVaWQiOjEyNzA2NzY2Nzk1NDY3MDQsInN0YXJ0VGltZSI6MTY0MTQ1NDYzNjExMiwic3RlcCI6LTEsInRpbWVvdXQiOjEyMCwid2luZG93Ijo2MH0***'),
  dataResults?: [
    MetricStat
  ](name='DataResults', description='The data returned in this call.'),
  hasNext?: boolean(name='HasNext', description='Indicates whether the data has been exported. Valid values:

*   true: Some data is not exported.
*   false: All the data is exported.', example='true'),
  length?: int32(name='Length', description='The number of data entries returned in this call.', example='1000'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='251402CD-305C-1617-808E-D8C11FC8138D'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model BatchExportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchExportResponseBody(name='body'),
}

/**
 * @summary Exports the monitoring data that is defined in the Cursor operation.
 *
 * @description ### [](#)Prerequisites
 * The `Cursor` information is returned by calling the [Cursor](https://help.aliyun.com/document_detail/2330730.html) operation.
 * ### [](#)Description
 * This topic provides an example on how to export the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The `Cursor` information is specified. A maximum of 1,000 data entries can be returned in each response.
 *
 * @param tmpReq BatchExportRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchExportResponse
 */
async function batchExportWithOptions(tmpReq: BatchExportRequest, runtime: Util.RuntimeOptions): BatchExportResponse {
  Util.validateModel(tmpReq);
  var request = new BatchExportShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.measurements)) {
    request.measurementsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.measurements, 'Measurements', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.cursor)) {
    body['Cursor'] = request.cursor;
  }
  if (!Util.isUnset(request.length)) {
    body['Length'] = request.length;
  }
  if (!Util.isUnset(request.measurementsShrink)) {
    body['Measurements'] = request.measurementsShrink;
  }
  if (!Util.isUnset(request.metric)) {
    body['Metric'] = request.metric;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BatchExport',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Exports the monitoring data that is defined in the Cursor operation.
 *
 * @description ### [](#)Prerequisites
 * The `Cursor` information is returned by calling the [Cursor](https://help.aliyun.com/document_detail/2330730.html) operation.
 * ### [](#)Description
 * This topic provides an example on how to export the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The `Cursor` information is specified. A maximum of 1,000 data entries can be returned in each response.
 *
 * @param request BatchExportRequest
 * @return BatchExportResponse
 */
async function batchExport(request: BatchExportRequest): BatchExportResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchExportWithOptions(request, runtime);
}

model CreateDynamicTagGroupRequest {
  contactGroupList?: [ string ](name='ContactGroupList', description='This parameter is required.', example='ECS_Group'),
  enableInstallAgent?: boolean(name='EnableInstallAgent', description='Specifies whether the CloudMonitor agent is automatically installed for the application group. CloudMonitor determines whether to automatically install the CloudMonitor agent for the hosts in an application group based on the value of this parameter. Valid values:

*   true: The CloudMonitor agent is automatically installed.
*   false (default value): The CloudMonitor agent is not automatically installed.', example='true'),
  enableSubscribeEvent?: boolean(name='EnableSubscribeEvent', description='Specifies whether the application group automatically subscribes to event notifications. If events whose severity level is critical or warning occur on resources in an application group, CloudMonitor sends alert notifications. Valid values:

*   true: The application group automatically subscribes to event notifications.
*   false (default value): The application group does not automatically subscribe to event notifications.', example='true'),
  matchExpress?: [ 
    {
      tagName?: string(name='TagName', description='The keys of the tags that are used to create the application group. If a specified key is attached to multiple resources, the resources that have the same key-value pair are added to the same group.', example='appname'),
      tagValue?: string(name='TagValue', description='The tag values of the cloud resources. Set the value of N to 1.

>  If you set the `MatchExpress.N.TagValueMatchFunction` parameter, you must also set the `MatchExpress.N.TagValue` parameter.', example='instance'),
      tagValueMatchFunction?: string(name='TagValueMatchFunction', description='The method that is used to match the tag values of the cloud resources. Set the value of N to 1. Valid values:

*   contains: contains
*   startWith: starts with a prefix
*   endWith: ends with a suffix
*   notContains: does not contain
*   equals: equals
*   all: matches all

>  If you set the `MatchExpress.N.TagValueMatchFunction` parameter, you must also set the `MatchExpress.N.TagValue` parameter.', example='contains'),
    }
  ](name='MatchExpress', description='The conditional expressions used to create an application group based on the tag.

This parameter is required.'),
  matchExpressFilterRelation?: string(name='MatchExpressFilterRelation', description='The relationship between the conditional expressions for the tag values of the cloud resources. Valid values:

*   and (default value)
*   or', example='and'),
  regionId?: string(name='RegionId'),
  tagKey?: string(name='TagKey', description='The tag keys of the cloud resources.

For more information about how to obtain tag keys, see [DescribeTagKeyList](https://help.aliyun.com/document_detail/145558.html).

This parameter is required.', example='ecs_instance'),
  tagRegionId?: string(name='TagRegionId', description='The ID of the region to which the tags belong.', example='cn-hangzhou'),
  templateIdList?: [ string ](name='TemplateIdList', example='85****'),
}

model CreateDynamicTagGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call is successful.', example='200'),
  id?: string(name='Id', description='The ID of the tag matching rule.', example='2534dc0a-e3e5-4ae1-a2fc-75ef166c****'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='84AC6F0B-7945-466A-AA44-99BB5A561F86'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model CreateDynamicTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDynamicTagGroupResponseBody(name='body'),
}

/**
 * @summary Creates an application group based on the tags of cloud resources.
 *
 * @description This operation is available for Elastic Compute Service (ECS), ApsaraDB RDS, and Server Load Balancer (SLB).
 * This topic provides an example to show how to create an application group for resources whose tag key is `ecs_instance`. In this example, the alert contact group of the application group is `ECS_Group`.
 *
 * @param request CreateDynamicTagGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDynamicTagGroupResponse
 */
async function createDynamicTagGroupWithOptions(request: CreateDynamicTagGroupRequest, runtime: Util.RuntimeOptions): CreateDynamicTagGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroupList)) {
    query['ContactGroupList'] = request.contactGroupList;
  }
  if (!Util.isUnset(request.enableInstallAgent)) {
    query['EnableInstallAgent'] = request.enableInstallAgent;
  }
  if (!Util.isUnset(request.enableSubscribeEvent)) {
    query['EnableSubscribeEvent'] = request.enableSubscribeEvent;
  }
  if (!Util.isUnset(request.matchExpress)) {
    query['MatchExpress'] = request.matchExpress;
  }
  if (!Util.isUnset(request.matchExpressFilterRelation)) {
    query['MatchExpressFilterRelation'] = request.matchExpressFilterRelation;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  if (!Util.isUnset(request.tagRegionId)) {
    query['TagRegionId'] = request.tagRegionId;
  }
  if (!Util.isUnset(request.templateIdList)) {
    query['TemplateIdList'] = request.templateIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDynamicTagGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application group based on the tags of cloud resources.
 *
 * @description This operation is available for Elastic Compute Service (ECS), ApsaraDB RDS, and Server Load Balancer (SLB).
 * This topic provides an example to show how to create an application group for resources whose tag key is `ecs_instance`. In this example, the alert contact group of the application group is `ECS_Group`.
 *
 * @param request CreateDynamicTagGroupRequest
 * @return CreateDynamicTagGroupResponse
 */
async function createDynamicTagGroup(request: CreateDynamicTagGroupRequest): CreateDynamicTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDynamicTagGroupWithOptions(request, runtime);
}

model CreateGroupMetricRulesRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

This parameter is required.', example='123456'),
  groupMetricRules?: [ 
    {
      escalations?: {
        critical?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: string(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Critical'),
        info?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: string(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Info'),
        warn?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: string(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Warn'),
      }(name='Escalations'),
      category?: string(name='Category', description='The name of the cloud service. Valid values of N: 1 to 200. Valid value:

*   PolarDB: PolarDB
*   NewBGPDDoS: Anti-DDoS Pro
*   IoTDevice: IoT Platform
*   DRDS: Distributed Relational Database Service (DRDS)
*   VS: Video Surveillance System
*   AMQP: Alibaba Cloud Message Queue for AMQP
*   ADS: AnalyticDB
*   APIGateway: API Gateway
*   InternetSharedBandwidth: EIP Bandwidth Plan
*   CDN: Alibaba Cloud Content Delivery Network (CDN)
*   CEN: Cloud Enterprise Network (CEN)
*   DCDN: Dynamic Route for CDN (DCDN)
*   DDoS: Anti-DDoS
*   ECS: Elastic Compute Service (ECS)
*   DirectMail: Direct Mail
*   Elasticsearch: Elasticsearch
*   EMR: E-MapReduce (EMR)
*   ESS: Auto Scaling
*   FunctionCompute: Function Compute
*   RealtimeCompute: Realtime Compute for Apache Flink
*   GlobalAcceleration: Global Accelerator (GA)
*   Hbase: ApsaraDB for HBase
*   TSDB: Time Series Database (TSDB)
*   IPv6trans: IPv6 Translation Service
*   Kafka: Message Queue for Apache Kafka
*   Kubernetes: Container Service for Kubernetes (ACK)
*   KVstore: ApsaraDB for Redis
*   MNS: Message Service (MNS)
*   MongoDB: ApsaraDB for MongoDB
*   MQ: Message Queue
*   NAT: NAT Gateway
*   OpenAd: Open Ad
*   OpenSearch: Open Search
*   OSS: Object Storage Service (OSS)
*   PCDN: P2P CDN
*   petadata: HybridDB for MySQL
*   RDS: ApsaraDB RDS
*   SCDN: Secure CDN
*   SLB: Server Load Balancer (SLB)
*   SLS: Log Service
*   VideoLive: ApsaraVideo Live
*   VOD: ApsaraVideo VOD
*   EIP: Elastic IP Address (EIP)
*   VPN: VPN Gateway
*   AIRec: Artificial Intelligence Recommendation
*   GPDB: AnalyticDB for PostgreSQL
*   DBS: Database Backup (DBS)
*   SAG: Smart Access Gateway (SAG)
*   Memcache: ApsaraDB for Memcache
*   IOT_EDGE: Link IoT Edge
*   OCS: ApsaraDB for Memcache (previous version)
*   VPC: Express Connect
*   EHPC: Elastic High Performance Computing (E-HPC)
*   MPS: ApsaraVideo Media Processing
*   ENS: Edge Node Service (ENS)
*   MaxCompute_Prepay: MaxCompute
*   IoT_Kubernetes: Edge Application Hosting
*   CMS: CloudMonitor
*   batchcomputenew: Batch Compute
*   HBaseUE: ApsaraDB for HBase Performance-enhanced Edition
*   UIS: Ultimate Internet Service (UIS)
*   nls: Intelligent Speech Interaction
*   ots: Tablestore
*   NAS: File Storage NAS
*   ECI: Elastic Container Instance (ECI)
*   OpenAPI: OpenAPI Explorer
*   pvtzpost: Alibaba Cloud DNS PrivateZone
*   blinkonk8s: Flink on Kubernetes
*   FunctionFlow: Serverless Workflow (SWF)
*   SMC: Server Migration Center (SMC)
*   ddosbgp: Anti-DDoS Origin
*   baas: Blockchain as a Service
*   privatelink: PrivateLink
*   cds: ApsaraDB for Cassandra
*   DDH: Dedicated Host
*   RocketMQ: Message Queue for Apache RocketMQ
*   ECC: Express Cloud Connect
*   hbaseserverless: ApsaraDB for HBase Serverless Edition
*   mns_tmp: Message Service
*   hdr: Hybrid Disaster Recovery (HDR)
*   hbr: Hybrid Backup Recovery (HBR)
*   ADB: AnalyticDB for MySQL V3.0
*   tag: Tag Service
*   GDB: Graph Database
*   WAF: Web Application Firewall (WAF)
*   hcs_sgw: Cloud Storage Gateway (CSG)
*   ipv6gateway: IPv6 Gateway
*   RDS_SAR: ApsaraDB Exclusive Host Group
*   learn: Machine Learning Platform for AI
*   ROS: Resource Orchestration Service (ROS)
*   OOS: Operation Orchestration Service (OOS)
*   bds: Data Synchronization for HBase
*   cfw: Cloud Firewall
*   ddosDip: Anti-DDoS Premium
*   datahub: DataHub
*   hologres: Hologres
*   ExpressConnect: Express Connect
*   dbfs: Database File System (DBFS)
*   clickhouse: ApsaraDB for ClickHouse
*   k8s: Container Service for Kubernetes (ACK)
*   DTS: Data Transmission Service (DTS)
*   AnycastEIP: Anycast Elastic IP Address
*   Lindorm: ApsaraDB for Lindorm
*   config: Cloud Config
*   spark: Databricks DataInsight (DDI)
*   serverless: Serverless App Engine (SAE)
*   alb: Application Load Balancer (ALB)
*   oceanbase: ApsaraDB for OceanBase
*   KMS: Key Management Service (KMS)
*   lvwang: Content Moderation
*   LinkVisual: LinkVisual
*   tair: ApsaraDB for Redis Enhanced Edition (Tair)
*   dlf: Data Lake Formation (DLF)
*   networkmonitor: Site Monitoring
*   pnc: Physical Network Change
*   AIS: Alibaba Cloud Infrastructure
*   cloudgame: Cloud Gaming Platform
*   RTC: Real-Time Communication
*   cloudbox: CloudBox
*   actiontrail: ActionTrail
*   cc: Cloud Connector
*   disk: Elastic Block Storage (EBS)
*   easygene: Genomics Computing Platform
*   cloudphone: Elastic Cloud Phone
*   BMS: Bare Metal Management Service
*   swas: Simple Application Server
*   AvailabilityMonitoring: Availability Monitoring of CloudMonitor

This parameter is required.', example='ECS'),
      contactGroups?: string(name='ContactGroups', description='The alert contact groups. Valid values of N: 1 to 200.

For information about how to obtain alert contact groups, see [DescribeContactGroupList](https://help.aliyun.com/document_detail/114922.html).', example='ECS_Group'),
      dimensions?: string(name='Dimensions', description='The dimension of the alert rule. Valid values of N: 1 to 200.

Set the value to a set of key-value pairs, for example, `userId:120886317861****` or `instanceId:i-m5e1qg6uo38rztr4****`.', example='[{"instanceId":"i-m5e1qg6uo38rztr4****"}]'),
      effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective. Valid values of N: 1 to 200.', example='05:31-23:59'),
      emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email. Valid values of N: 1 to 200.'),
      interval?: string(name='Interval', description='The interval at which CloudMonitor checks whether the alert rule is triggered. Valid values of N: 1 to 200.

Unit: seconds. The default value is the lowest frequency at which the metric is polled.

>  We recommend that you set the interval to the data aggregation period. If the interval is shorter than the data aggregation period, alerts cannot be triggered due to insufficient data.', example='60'),
      labels?: [ 
        {
          key?: string(name='Key', description='The tag key of the alert rule. The specified tag is contained in alert notifications.

Valid values of N: 1 to 200.', example='key1'),
          value?: string(name='Value', description='The tag value of the alert rule. The specified tag is contained in alert notifications.

Valid values of N: 1 to 200.', example='value1'),
        }
      ](name='Labels'),
      metricName?: string(name='MetricName', description='The name of the metric. Valid values of N: 1 to 200.

For information about how to obtain the name of a metric, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service. Valid values of N: 1 to 200.

For information about how to obtain the namespace of a cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
      noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid values of N: 1 to 200. Valid value:

*   KEEP_LAST_STATE (default value): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The alert rule has no active alerts.', example='KEEP_LAST_STATE'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective. Valid values of N: 1 to 200.', example='00:00-05:30'),
      options?: string(name='Options', example='{
      "NotSendOK": true
}'),
      period?: string(name='Period', description='The aggregation period of the metric data. Valid values of N: 1 to 200.

Set the `Period` parameter to an integral multiple of 60. Unit: seconds. Default value: 300.', example='60'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule. Valid values of N: 1 to 200.

This parameter is required.', example='456789'),
      ruleName?: string(name='RuleName', description='The name of the alert rule. Valid values of N: 1 to 200.

This parameter is required.', example='ECS_Rule1'),
      silenceTime?: int32(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Valid values of N: 1 to 200.

Unit: seconds. Default value: 86400. Minimum value: 3600.', example='86400'),
      webhook?: string(name='Webhook', description='The callback URL. Valid values of N: 1 to 200.

The callback URL must be accessible over the Internet. CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.', example='https://www.aliyun.com'),
    }
  ](name='GroupMetricRules'),
  regionId?: string(name='RegionId'),
}

model CreateGroupMetricRulesResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='461CF2CD-2FC3-4B26-8645-7BD27E7D0F1D'),
  resources?: {
    alertResult?: [ 
    {
      code?: int32(name='Code', description='The status code that is returned for the alert rule.

>  The status code 200 indicates that the call is successful.', example='200'),
      message?: string(name='Message', description='The error message that is returned for the alert rule.', example='Metric not found.'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='456789'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='ECS_Rule1'),
      success?: boolean(name='Success', description='Indicates whether the alert rule was created. Valid value:

- true: The alert rule was created.
- false: The alert rule failed to be created.', example='true'),
    }
  ](name='AlertResult')
  }(name='Resources', description='The details of the alert rules.'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid value:

- true: The call is successful.
- false: The call fails.', example='true'),
}

model CreateGroupMetricRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGroupMetricRulesResponseBody(name='body'),
}

/**
 * @summary Creates one or more alert rules for a specified application group.
 *
 * @description This topic provides an example to show how to create an alert rule for the `cpu_total` metric of Elastic Compute Service (ECS) in the `123456` application group. The ID of the alert rule is `456789`. The name of the alert rule is `ECS_Rule1`. The alert level is `Critical`. The statistical method is `Average`. The comparison operator is `GreaterThanOrEqualToThreshold`. The alert threshold is `90`. The number of alert retries is `3`. The response shows that the alert rule named `ECS_Rule1` is created.
 *
 * @param request CreateGroupMetricRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGroupMetricRulesResponse
 */
async function createGroupMetricRulesWithOptions(request: CreateGroupMetricRulesRequest, runtime: Util.RuntimeOptions): CreateGroupMetricRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupMetricRules)) {
    query['GroupMetricRules'] = request.groupMetricRules;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroupMetricRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates one or more alert rules for a specified application group.
 *
 * @description This topic provides an example to show how to create an alert rule for the `cpu_total` metric of Elastic Compute Service (ECS) in the `123456` application group. The ID of the alert rule is `456789`. The name of the alert rule is `ECS_Rule1`. The alert level is `Critical`. The statistical method is `Average`. The comparison operator is `GreaterThanOrEqualToThreshold`. The alert threshold is `90`. The number of alert retries is `3`. The response shows that the alert rule named `ECS_Rule1` is created.
 *
 * @param request CreateGroupMetricRulesRequest
 * @return CreateGroupMetricRulesResponse
 */
async function createGroupMetricRules(request: CreateGroupMetricRulesRequest): CreateGroupMetricRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupMetricRulesWithOptions(request, runtime);
}

model CreateGroupMonitoringAgentProcessRequest {
  alertConfig?: [ 
    {
      comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the previous monitoring cycle

Valid values of N: 1 to 3.

This parameter is required.', example='GreaterThanOrEqualToThreshold'),
      effectiveInterval?: string(name='EffectiveInterval', description='The period of time during which the alert rule is effective.

Valid values of N: 1 to 3.', example='00:00-23:59'),
      escalationsLevel?: string(name='EscalationsLevel', description='The alert level. Valid values:

*   critical (default)
*   warn
*   info

Valid values of N: 1 to 3.

This parameter is required.', example='warn'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='This parameter is deprecated.', example='00:00-23:59'),
      silenceTime?: string(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met. Unit: seconds. Minimum value: 3600, which is equivalent to one hour. Default value: 86400, which is equivalent to one day.

Valid values of N: 1 to 3.

>  Only one alert notification is sent during a mute period even if the metric value exceeds the alert threshold during consecutive checks.', example='86400'),
      statistics?: string(name='Statistics', description='The statistical aggregation method that is used to calculate the metric values.

Valid values of N: 1 to 3.

>  Set the value to Average.

This parameter is required.', example='Average'),
      targetList?: [ 
        {
          arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource.

For more information about how to query the ARN of a resource, see [DescribeMetricRuleTargets](https://help.aliyun.com/document_detail/121592.html).

Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. Fields:

*   {Service name abbreviation}: the abbreviation of the service name. Set the value to Simple Message Queue (formerly MNS) (SMQ).

*   {userId}: the ID of the Alibaba Cloud account.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {Resource type}: the type of the resource that triggers the alert. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
          id?: string(name='Id', description='The ID of the resource for which alerts are triggered.

For more information about how to obtain the ID of a resource for which alerts are triggered, see [DescribeMetricRuleTargets](https://help.aliyun.com/document_detail/121592.html).', example='1'),
          jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
          level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='["INFO", "WARN", "CRITICAL"]'),
        }
      ](name='TargetList', description='The alert triggers.'),
      threshold?: string(name='Threshold', description='The alert threshold.

Valid values of N: 1 to 3.

This parameter is required.', example='5'),
      times?: string(name='Times', description='The number of times for which the threshold can be consecutively exceeded. Default value: 3.

Valid values of N: 1 to 3.

>  A metric triggers an alert only after the metric value reaches the threshold consecutively for the specified times.

This parameter is required.', example='3'),
      webhook?: string(name='Webhook', description='The callback URL.

Valid values of N: 1 to 3.', example='http://www.aliyun.com'),
    }
  ](name='AlertConfig', description='The alert rule configurations.

Valid values of N: 1 to 3.

This parameter is required.'),
  groupId?: string(name='GroupId', description='The ID of the application group.

For more information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

This parameter is required.', example='123456'),
  matchExpress?: [ 
    {
      function?: string(name='Function', description='The matching condition. Valid values:

*   all (default value): matches all
*   startWith: starts with a prefix
*   endWith: ends with a suffix
*   contains: contains
*   notContains: does not contain
*   equals: equals

Valid values of N: 1 to 3.', example='startWith'),
      name?: string(name='Name', description='The criteria based on which the instances are matched.

Valid values of N: 1 to 3.

> Set the value to name. The value name indicates that the instances are matched based on the instance name.', example='name1'),
      value?: string(name='Value', description='The keyword used to match the instance name.

Valid values of N: 1 to 3.', example='portalHost'),
    }
  ](name='MatchExpress', description='The expressions used to match instances.

Valid values of N: 1 to 3.'),
  matchExpressFilterRelation?: string(name='MatchExpressFilterRelation', description='The logical operator used between conditional expressions that are used to match instances. Valid values:

*   all
*   and
*   or', example='and'),
  processName?: string(name='ProcessName', description='The process name.

This parameter is required.', example='test1'),
  regionId?: string(name='RegionId'),
}

model CreateGroupMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3F6150F9-45C7-43F9-9578-A58B2E726C90'),
  resource?: {
    groupProcessId?: string(name='GroupProcessId', description='The ID of the group process.', example='7F2B0024-4F21-48B9-A764-211CEC48****'),
  }(name='Resource', description='The group process information.'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
}

model CreateGroupMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateGroupMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @summary Creates a process monitoring task for an application group.
 *
 * @param request CreateGroupMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateGroupMonitoringAgentProcessResponse
 */
async function createGroupMonitoringAgentProcessWithOptions(request: CreateGroupMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): CreateGroupMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertConfig)) {
    query['AlertConfig'] = request.alertConfig;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.matchExpress)) {
    query['MatchExpress'] = request.matchExpress;
  }
  if (!Util.isUnset(request.matchExpressFilterRelation)) {
    query['MatchExpressFilterRelation'] = request.matchExpressFilterRelation;
  }
  if (!Util.isUnset(request.processName)) {
    query['ProcessName'] = request.processName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroupMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a process monitoring task for an application group.
 *
 * @param request CreateGroupMonitoringAgentProcessRequest
 * @return CreateGroupMonitoringAgentProcessResponse
 */
async function createGroupMonitoringAgentProcess(request: CreateGroupMonitoringAgentProcessRequest): CreateGroupMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupMonitoringAgentProcessWithOptions(request, runtime);
}

model CreateHostAvailabilityRequest {
  alertConfig?: {
    endTime?: int32(name='EndTime', description='The end of the time range during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

> Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='22'),
    notifyType?: int32(name='NotifyType', description='The alert notification methods. Valid values:

0: Alert notifications are sent by using emails and DingTalk chatbots.

This parameter is required.', example='0'),
    silenceTime?: int32(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400. The default value indicates one day.', example='86400'),
    startTime?: int32(name='StartTime', description='The beginning of the time range during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

> Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='0'),
    webHook?: string(name='WebHook', description='The callback URL.', example='https://www.aliyun.com/webhook.json'),
  }(name='AlertConfig'),
  taskOption?: {
    httpHeader?: string(name='HttpHeader', description='The header of the HTTP request. Format: `Parameter name:Parameter value`. Separate multiple parameters with carriage return characters. Example:

    params1:value1
    params2:value2', example='token:testTokenValue'),
    httpMethod?: string(name='HttpMethod', description='The HTTP request method. Valid values:

*   GET
*   POST
*   HEAD

> This parameter must be specified when TaskType is set to HTTP.', example='GET'),
    httpNegative?: boolean(name='HttpNegative', description='The method to trigger an alert. The alert can be triggered based on whether the specified alert rule is included in the response body. Valid values:

*   true: If the HTTP response body includes the alert rule, an alert is triggered.
*   false: If the HTTP response does not include the alert rule, an alert is triggered.

> This parameter must be specified when TaskType is set to HTTP.', example='true'),
    httpPostContent?: string(name='HttpPostContent', description='The content of the HTTP POST request.', example='params1=paramsValue1'),
    httpResponseCharset?: string(name='HttpResponseCharset', description='The character set that is used in the HTTP response.

> Only UTF-8 is supported.', example='UTF-8'),
    httpResponseMatchContent?: string(name='HttpResponseMatchContent', description='The response to the HTTP request.', example='ok'),
    httpURI?: string(name='HttpURI', description='The URI that you want to monitor. This parameter is required if the TaskType parameter is set to HTTP or Telnet.', example='https://www.aliyun.com'),
    interval?: int32(name='Interval', description='The interval at which detection requests are sent. Unit: seconds. Valid values: 15, 30, 60, 120, 300, 900, 1800, and 3600.

> This parameter is available only for the CloudMonitor agent V3.5.1 or later.', example='60'),
    telnetOrPingHost?: string(name='TelnetOrPingHost', description='The domain name or IP address that you want to monitor.

>  This parameter is required if the TaskType parameter is set to PING.', example='www.aliyun.com'),
  }(name='TaskOption'),
  alertConfigEscalationList?: [ 
    {
      aggregate?: string(name='Aggregate', description='The method used to calculate the metric values that trigger alerts. Valid values of N: 1 to 21. Valid values:

*   HttpStatus: Value
*   HttpLatency: Average
*   TelnetStatus: Value
*   TelnetLatency: Average
*   PingLostRate: Average

> The value Value indicates the original value and is used for metrics such as status codes. The value Average indicates the average value and is used for metrics such as the latency and packet loss rate.', example='Value'),
      metricName?: string(name='MetricName', description='The metric for which the alert feature is enabled. Valid values of N: 1 to 21. Valid values:

*   HttpStatus: HTTP status code
*   HttpLatency: HTTP response time
*   TelnetStatus: Telnet status code
*   TelnetLatency: Telnet response time
*   PingLostRate: Ping packet loss rate

This parameter is required.', example='HttpStatus'),
      operator?: string(name='Operator', description='The comparison operator that is used in the alert rule. Valid values of N: 1 to 21. Valid values:

*   `>`
*   `>=`
*   `<`
*   `<=`
*   `=`', example='>'),
      times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered. Valid values of N: 1 to 21.', example='3'),
      value?: string(name='Value', description='The alert threshold. Valid values of N: 1 to 21.', example='90'),
    }
  ](name='AlertConfigEscalationList', description='None

This parameter is required.'),
  alertConfigTargetList?: [ 
    {
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource. Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. Fields:

*   {Service name abbreviation}: the abbreviation of the service name. Set the value to Simple Message Queue (formerly MNS) (SMQ).

*   {userId}: the ID of the Alibaba Cloud account.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {Resource type}: the type of the resource for which alerts are triggered. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
      id?: string(name='Id', description='The ID of the resource for which alerts are triggered.', example='1'),
      jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
      level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='["INFO", "WARN", "CRITICAL"]'),
    }
  ](name='AlertConfigTargetList', description='The resources for which alerts are triggered.'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  instanceList?: [ string ](name='InstanceList', description='The ECS instances that are monitored. Valid values of N: 1 to 21.

> This parameter must be specified when `TaskScope` is set to `GROUP_SPEC_INSTANCE`.', example='i-absdfkwl321****'),
  regionId?: string(name='RegionId'),
  taskName?: string(name='TaskName', description='The name of the availability monitoring task. The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_).

This parameter is required.', example='task1'),
  taskScope?: string(name='TaskScope', description='The range of instances that are monitored by the availability monitoring task. Valid values:

*   GROUP: All Elastic Compute Service (ECS) instances in the application group are monitored.
*   GROUP_SPEC_INSTANCE: Specified ECS instances in the application group are monitored. The TaskScope parameter must be used in combination with the InstanceList.N parameter. The InstanceList.N parameter specifies the ECS instances to be monitored.', example='GROUP'),
  taskType?: string(name='TaskType', description='The monitoring type of the availability monitoring task. Valid values:

*   PING
*   TELNET
*   HTTP

This parameter is required.', example='HTTP'),
}

model CreateHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='ACBDBB40-DFB6-4F4C-8957-51FFB233969C'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: long(name='TaskId', description='The ID of the availability monitoring task.', example='12345'),
}

model CreateHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHostAvailabilityResponseBody(name='body'),
}

/**
 * @summary Creates an availability monitoring task.
 *
 * @description This topic provides an example on how to create an availability monitoring task named `task1` in an application group named `123456`. The TaskType parameter of the task is set to `HTTP`. After you start the task, the system sends alerts by using the specified email address and DingTalk chatbot.
 *
 * @param request CreateHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHostAvailabilityResponse
 */
async function createHostAvailabilityWithOptions(request: CreateHostAvailabilityRequest, runtime: Util.RuntimeOptions): CreateHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertConfigEscalationList)) {
    query['AlertConfigEscalationList'] = request.alertConfigEscalationList;
  }
  if (!Util.isUnset(request.alertConfigTargetList)) {
    query['AlertConfigTargetList'] = request.alertConfigTargetList;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceList)) {
    query['InstanceList'] = request.instanceList;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskScope)) {
    query['TaskScope'] = request.taskScope;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.alertConfig)) {
    query['AlertConfig'] = request.alertConfig;
  }
  if (!Util.isUnset(request.taskOption)) {
    query['TaskOption'] = request.taskOption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an availability monitoring task.
 *
 * @description This topic provides an example on how to create an availability monitoring task named `task1` in an application group named `123456`. The TaskType parameter of the task is set to `HTTP`. After you start the task, the system sends alerts by using the specified email address and DingTalk chatbot.
 *
 * @param request CreateHostAvailabilityRequest
 * @return CreateHostAvailabilityResponse
 */
async function createHostAvailability(request: CreateHostAvailabilityRequest): CreateHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHostAvailabilityWithOptions(request, runtime);
}

model CreateHybridMonitorNamespaceRequest {
  description?: string(name='Description', description='The description of the namespace.'),
  namespace?: string(name='Namespace', description='The name of the namespace.

The name can contain lowercase letters, digits, and hyphens (-).

This parameter is required.', example='aliyun'),
  namespaceRegion?: string(name='NamespaceRegion', description='The region where the metric data is stored.', example='cn-hangzhou'),
  namespaceType?: string(name='NamespaceType', description='The storage scheme of metric data. Valid values:

*   m_prom_user: The metric data is stored in Simple Log Service.
*   m_prom_pool: The metric data is stored in the private storage space provided by CloudMonitor.

>  For more information about the storage schemes of metric data, see [Data storage schemes for Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/2594921.html).', example='m_prometheus'),
  regionId?: string(name='RegionId'),
  spec?: string(name='Spec', description='The data retention period. Valid values:

*   cms.s1.large (Retention Period 15 Days)
*   cms.s1.xlarge (Retention Period 32 Days)
*   cms.s1.2xlarge (Retention Period 63 Days)
*   cms.s1.3xlarge (Retention Period 93 Days) (default)
*   cms.s1.6xlarge (Retention Period 185 Days)
*   cms.s1.12xlarge (Retention Period 367 Days)

For information about the pricing for different retention periods, see the **Pricing** section in [Billing of the dashboard feature](https://help.aliyun.com/document_detail/223532.html).', example='cms.s1.3xlarge'),
}

model CreateHybridMonitorNamespaceResponseBody = {
  code?: string(name='Code', description='The response code.', example='Success'),
  message?: string(name='Message', description='The error message returned.', example='Namespace.Existed'),
  requestId?: string(name='RequestId', description='The request ID.', example='3843D23A-FB9E-5DC8-BCCC-458768B79296'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateHybridMonitorNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHybridMonitorNamespaceResponseBody(name='body'),
}

/**
 * @summary Creates a namespace.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Description
 * This topic provides an example on how to create a namespace named `aliyun`. In this example, the data retention period of the namespace is set to `cms.s1.3xlarge`. The returned result indicates that the namespace is created.
 *
 * @param request CreateHybridMonitorNamespaceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHybridMonitorNamespaceResponse
 */
async function createHybridMonitorNamespaceWithOptions(request: CreateHybridMonitorNamespaceRequest, runtime: Util.RuntimeOptions): CreateHybridMonitorNamespaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.namespaceRegion)) {
    query['NamespaceRegion'] = request.namespaceRegion;
  }
  if (!Util.isUnset(request.namespaceType)) {
    query['NamespaceType'] = request.namespaceType;
  }
  if (!Util.isUnset(request.spec)) {
    query['Spec'] = request.spec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHybridMonitorNamespace',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a namespace.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Description
 * This topic provides an example on how to create a namespace named `aliyun`. In this example, the data retention period of the namespace is set to `cms.s1.3xlarge`. The returned result indicates that the namespace is created.
 *
 * @param request CreateHybridMonitorNamespaceRequest
 * @return CreateHybridMonitorNamespaceResponse
 */
async function createHybridMonitorNamespace(request: CreateHybridMonitorNamespaceRequest): CreateHybridMonitorNamespaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHybridMonitorNamespaceWithOptions(request, runtime);
}

model CreateHybridMonitorSLSGroupRequest {
  regionId?: string(name='RegionId'),
  SLSGroupConfig?: [ 
    {
      SLSLogstore?: string(name='SLSLogstore', description='The Logstore.

Valid values of N: 1 to 25.

This parameter is required.', example='Logstore-ECS'),
      SLSProject?: string(name='SLSProject', description='The Simple Log Service project.

Valid values of N: 1 to 25.

This parameter is required.', example='aliyun-project'),
      SLSRegion?: string(name='SLSRegion', description='The region ID.

Valid values of N: 1 to 25.

This parameter is required.', example='cn-hangzhou'),
      SLSUserId?: string(name='SLSUserId', description='The member ID.

Valid values of N: 1 to 25.

If you call this operation by using the management account of a resource directory, you can connect the Alibaba Cloud services that are activated for all members in the resource directory to Hybrid Cloud Monitoring. You can use the resource directory to monitor Alibaba Cloud services across enterprise accounts.

> If a member uses CloudMonitor for the first time, you must make sure that the service-linked role AliyunServiceRoleForCloudMonitor is attached to the member. For more information, see [Manage the service-linked role for CloudMonitor](https://help.aliyun.com/document_detail/170423.html).', example='120886317861****'),
    }
  ](name='SLSGroupConfig', description='The configurations of the Logstore group.

Valid values of N: 1 to 25.

This parameter is required.'),
  SLSGroupDescription?: string(name='SLSGroupDescription', description='The description of the Logstore group.'),
  SLSGroupName?: string(name='SLSGroupName', description='The name of the Logstore group.

The name must be 2 to 32 characters in length and can contain uppercase letters, lowercase letters, digits, and underscores (_). The name must start with a letter.

This parameter is required.', example='Logstore_test'),
}

model CreateHybridMonitorSLSGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='Duplicate.SLSGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='66683237-7126-50F8-BBF8-D67ACC919A17'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateHybridMonitorSLSGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHybridMonitorSLSGroupResponseBody(name='body'),
}

/**
 * @summary Creates a Logstore group of Hybrid Cloud Monitoring.
 *
 * @description ## [](#)Prerequisites
 * Simple Log Service is activated. A project and a Logstore are created in Simple Log Service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/54604.html).
 * ## [](#)Description
 * This topic provides an example on how to create a Logstore group named `Logstore_test`. The region ID is `cn-hangzhou`. The project is `aliyun-project`. The Logstore is `Logstore-ECS`. The response shows that the Logstore group is created.
 *
 * @param request CreateHybridMonitorSLSGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHybridMonitorSLSGroupResponse
 */
async function createHybridMonitorSLSGroupWithOptions(request: CreateHybridMonitorSLSGroupRequest, runtime: Util.RuntimeOptions): CreateHybridMonitorSLSGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.SLSGroupConfig)) {
    query['SLSGroupConfig'] = request.SLSGroupConfig;
  }
  if (!Util.isUnset(request.SLSGroupDescription)) {
    query['SLSGroupDescription'] = request.SLSGroupDescription;
  }
  if (!Util.isUnset(request.SLSGroupName)) {
    query['SLSGroupName'] = request.SLSGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHybridMonitorSLSGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a Logstore group of Hybrid Cloud Monitoring.
 *
 * @description ## [](#)Prerequisites
 * Simple Log Service is activated. A project and a Logstore are created in Simple Log Service. For more information, see [Getting Started](https://help.aliyun.com/document_detail/54604.html).
 * ## [](#)Description
 * This topic provides an example on how to create a Logstore group named `Logstore_test`. The region ID is `cn-hangzhou`. The project is `aliyun-project`. The Logstore is `Logstore-ECS`. The response shows that the Logstore group is created.
 *
 * @param request CreateHybridMonitorSLSGroupRequest
 * @return CreateHybridMonitorSLSGroupResponse
 */
async function createHybridMonitorSLSGroup(request: CreateHybridMonitorSLSGroupRequest): CreateHybridMonitorSLSGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHybridMonitorSLSGroupWithOptions(request, runtime);
}

model CreateHybridMonitorTaskRequest {
  attachLabels?: [ 
    {
      name?: string(name='Name', description='The tag key of the metric.', example='app_service'),
      value?: string(name='Value', description='The tag value of the metric.', example='testValue'),
    }
  ](name='AttachLabels', description='The tags of the metric.

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_sls`.'),
  cloudAccessId?: [ string ](name='CloudAccessId'),
  collectInterval?: string(name='CollectInterval', description='The collection period of the metric. Valid values:

*   15
*   60 (default)

Unit: seconds.

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_sls`.', example='60'),
  collectTargetType?: string(name='CollectTargetType', description='The type of the collection target.

*   If the `TaskType` parameter is set to `aliyun_fc`, enter `aliyun_fc`.
*   If the `TaskType` parameter is set to `aliyun_sls`, enter the name of the Logstore group.

This parameter is required.', example='aliyun_fc'),
  description?: string(name='Description', description='The description of the metric import task.'),
  groupId?: string(name='GroupId', description='The ID of the application group.

For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_sls`.', example='3607****'),
  namespace?: string(name='Namespace', description='The name of the namespace.

For information about how to obtain the name of a namespace, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='aliyun'),
  regionId?: string(name='RegionId'),
  SLSProcessConfig?: {
    express?: [ 
      {
        alias?: string(name='Alias', description='The alias of the extended field that specifies the result of basic operations performed on aggregation results.', example='SuccRate'),
        express?: string(name='Express', description='The extended field that specifies the result of basic operations performed on aggregation results.', example='success_count'),
      }
    ](name='Express', description='The extended fields that specify the results of basic operations performed on aggregation results.'),
    filter?: {
      filters?: [ 
        {
          operator?: string(name='Operator', description='The method that is used to filter logs imported from Simple Log Service. Valid values:

*   `contain`: contains
*   `notContain`: does not contain
*   `>`: greater than
*   `<`: less than
*   `=`: equal to
*   `! =`: not equal to
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='='),
          SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to filter logs imported from Simple Log Service.', example='code'),
          value?: string(name='Value', description='The value of the key that is used to filter logs imported from Simple Log Service.', example='200'),
        }
      ](name='Filters', description='The conditions that are used to filter logs imported from Simple Log Service.'),
      relation?: string(name='Relation', description='The relationship between multiple filter conditions. Valid values:

*   and (default): Logs are processed only if all filter conditions are met.
*   or: Logs are processed if one of the filter conditions is met.', example='and'),
    }(name='Filter', description='The conditions that are used to filter logs imported from Simple Log Service.'),
    groupBy?: [ 
      {
        alias?: string(name='Alias', description='The alias of the aggregation result.', example='ApiResult'),
        SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Simple Log Service.', example='code'),
      }
    ](name='GroupBy', description='The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.'),
    statistics?: [ 
      {
        alias?: string(name='Alias', description='The alias of the aggregation result.', example='level_count'),
        function?: string(name='Function', description='The function that is used to aggregate the log data of a statistical period. Valid values:

*   count: counts the number.
*   sum: calculates the total value.
*   avg: calculates the average value.
*   max: calculates the maximum value.
*   min: calculates the minimum value.
*   value: collects samples within the statistical period.
*   countps: calculates the number of values of the specified field divided by the total number of seconds within a statistical period.
*   sumps: calculates the sum of the values of the specified field divided by the total number of seconds within a statistical period.
*   distinct: calculates the number of unique values of the specified field within a statistical period.
*   distribution: calculates the number of logs that meet a specified condition within the statistical period.
*   percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.', example='count'),
        parameter1?: string(name='Parameter1', description='The value of the function that is used to aggregate logs imported from Simple Log Service.

*   If the `Function` parameter is set to `distribution`, this parameter specifies the lower limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 200.
*   If the `Function` parameter is set to `percentile`, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.', example='200'),
        parameter2?: string(name='Parameter2', description='The value of the function that is used to aggregate logs imported from Simple Log Service.

>  This parameter is required only if the `Function` parameter is set to `distribution`. This parameter specifies the upper limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 299.', example='299'),
        SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Simple Log Service.', example='name'),
      }
    ](name='Statistics', description='The method that is used to aggregate logs imported from Simple Log Service.'),
  }(name='SLSProcessConfig', description='The configurations of the logs that are imported from Simple Log Service.

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_sls`.'),
  targetUserId?: string(name='TargetUserId', description='The ID of the member account.

If you call this operation by using the management account of a resource directory, you can connect the Alibaba Cloud services that are activated for all members in the resource directory to Hybrid Cloud Monitoring. You can use the resource directory to monitor Alibaba Cloud services across enterprise accounts.

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_fc`.', example='120886317861****'),
  targetUserIdList?: string(name='TargetUserIdList', description='The IDs of the member accounts. Separate multiple member account IDs with commas (,).

>  This parameter is required only if you call this operation by using the management account.', example='120886317861****'),
  taskName?: string(name='TaskName', description='The name of the metric import task.

*   If the `TaskType` parameter is set to `aliyun_fc`, enter the name of the metric import task.
*   If the `TaskType` parameter is set to `aliyun_sls`, enter the name of the metric for logs imported from Simple Log Service.', example='aliyun_task'),
  taskType?: string(name='TaskType', description='The type of the metric import task. Valid values:

*   aliyun_fc: metric import tasks for Alibaba Cloud services.
*   aliyun_sls: metrics for logs imported from Simple Log Service.

This parameter is required.', example='aliyun_fc'),
  YARMConfig?: string(name='YARMConfig', description='The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.

*   namespace: the namespace of the Alibaba Cloud service. For information about how to query the namespace of an Alibaba Cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html).
*   metric_list: the metrics of the Alibaba Cloud service. For information about how to query the metrics of an Alibaba Cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html).

The following code shows a sample configuration file:

    products:
    - namespace: acs_ecs_dashboard
      metric_info:
      - metric_list:
        - cpu_total
        - cpu_idle
        - diskusage_utilization
        - CPUUtilization
        - DiskReadBPS
        - InternetOut
        - IntranetOut
        - cpu_system
    - namespace: acs_rds_dashboard
      metric_info:
      - metric_list:
        - MySQL_QPS
        - MySQL_TPS

>  This parameter is required only if the `TaskType` parameter is set to `aliyun_fc`.', example='products:- namespace: acs_ecs_dashboard  metric_info:  - metric_list:    - cpu_total'),
}

model CreateHybridMonitorTaskResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message returned.', example='yamlConfigFail'),
  requestId?: string(name='RequestId', description='The request ID.', example='28CEA2E0-3E90-51B2-A7E8-B1ED75534E49'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskId?: long(name='TaskId', description='The ID of the monitoring task.', example='36****'),
}

model CreateHybridMonitorTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHybridMonitorTaskResponseBody(name='body'),
}

/**
 * @summary Creates a metric import task for an Alibaba Cloud service or creates a metric for logs imported from Simple Log Service.
 *
 * @description # [](#)Prerequisites
 * *   Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * *   If you want to create a metric for logs imported from Simple Log Service, make sure that you have activated Simple Log Service and created a project and a Logstore. For more information, see [Getting Started](https://help.aliyun.com/document_detail/54604.html).
 * # [](#)Description
 * This topic provides an example on how to create a metric import task named `aliyun_task` for Elastic Compute Service (ECS). The task imports the `cpu_total` metric to the `aliyun` namespace. The response shows that the metric import task is created.
 *
 * @param request CreateHybridMonitorTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHybridMonitorTaskResponse
 */
async function createHybridMonitorTaskWithOptions(request: CreateHybridMonitorTaskRequest, runtime: Util.RuntimeOptions): CreateHybridMonitorTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.attachLabels)) {
    query['AttachLabels'] = request.attachLabels;
  }
  if (!Util.isUnset(request.cloudAccessId)) {
    query['CloudAccessId'] = request.cloudAccessId;
  }
  if (!Util.isUnset(request.collectInterval)) {
    query['CollectInterval'] = request.collectInterval;
  }
  if (!Util.isUnset(request.collectTargetType)) {
    query['CollectTargetType'] = request.collectTargetType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.SLSProcessConfig)) {
    query['SLSProcessConfig'] = request.SLSProcessConfig;
  }
  if (!Util.isUnset(request.targetUserId)) {
    query['TargetUserId'] = request.targetUserId;
  }
  if (!Util.isUnset(request.targetUserIdList)) {
    query['TargetUserIdList'] = request.targetUserIdList;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.YARMConfig)) {
    query['YARMConfig'] = request.YARMConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHybridMonitorTask',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a metric import task for an Alibaba Cloud service or creates a metric for logs imported from Simple Log Service.
 *
 * @description # [](#)Prerequisites
 * *   Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * *   If you want to create a metric for logs imported from Simple Log Service, make sure that you have activated Simple Log Service and created a project and a Logstore. For more information, see [Getting Started](https://help.aliyun.com/document_detail/54604.html).
 * # [](#)Description
 * This topic provides an example on how to create a metric import task named `aliyun_task` for Elastic Compute Service (ECS). The task imports the `cpu_total` metric to the `aliyun` namespace. The response shows that the metric import task is created.
 *
 * @param request CreateHybridMonitorTaskRequest
 * @return CreateHybridMonitorTaskResponse
 */
async function createHybridMonitorTask(request: CreateHybridMonitorTaskRequest): CreateHybridMonitorTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHybridMonitorTaskWithOptions(request, runtime);
}

model CreateInstantSiteMonitorRequest {
  address?: string(name='Address', description='The URL or IP address that you want to test.

This parameter is required.', example='http://www.aliyun.com'),
  ispCities?: string(name='IspCities', description='The detection points. If you leave this parameter empty, the system randomly selects three detection points.

The value is a `JSON array`. Example: {"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}. The values of the city field indicate Beijing, Hangzhou, and Qingdao.

For information about how to obtain detection points, see [DescribeSiteMonitorISPCityList](https://help.aliyun.com/document_detail/115045.html).

> You must specify one of the `IspCities` and `RandomIspCity` parameters.', example='[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the protocol that is used by the instant test task. The options vary based on the protocol.', example='{"time_out":5000}'),
  randomIspCity?: int32(name='RandomIspCity', description='The number of detection points.

> 

*   You must specify one of the `IspCities` and `RandomIspCity` parameters. If you specify the `RandomIspCity` parameter, the `IspCities` parameter automatically becomes invalid.', example='1'),
  regionId?: string(name='RegionId'),
  taskName?: string(name='TaskName', description='The name of the instant test task.

The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_).

This parameter is required.', example='task1'),
  taskType?: string(name='TaskType', description='The type of the instant test task. Valid values: HTTP, PING, TCP, UDP, and DNS.

This parameter is required.', example='HTTP'),
}

model CreateInstantSiteMonitorResponseBody = {
  code?: string(name='Code', description='The error code.

> The status code 200 indicates that the call was successful.', example='200'),
  createResultList?: [ 
    {
      taskId?: string(name='TaskId', description='The ID of the instant test task.', example='2c8dbdf9-a3ab-46a1-85a4-f094965e****'),
      taskName?: string(name='TaskName', description='The name of the instant test task.', example='task1'),
    }
  ](name='CreateResultList', description='The results for creating the instant test task.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='68192f5d-0d45-4b98-9724-892813f86c71'),
  success?: string(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model CreateInstantSiteMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstantSiteMonitorResponseBody(name='body'),
}

/**
 * @summary Creates an instant test task.
 *
 * @description You can create an instant test task only by using the Alibaba Cloud account that you used to enable Network Analysis and Monitoring. 
 * This topic provides an example to show how to create an instant test task. The name of the task is `task1`. The tested address is `http://www.aliyun.com`. The test type is `HTTP`. The number of detection points is `1`.
 *
 * @param request CreateInstantSiteMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstantSiteMonitorResponse
 */
async function createInstantSiteMonitorWithOptions(request: CreateInstantSiteMonitorRequest, runtime: Util.RuntimeOptions): CreateInstantSiteMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.ispCities)) {
    query['IspCities'] = request.ispCities;
  }
  if (!Util.isUnset(request.optionsJson)) {
    query['OptionsJson'] = request.optionsJson;
  }
  if (!Util.isUnset(request.randomIspCity)) {
    query['RandomIspCity'] = request.randomIspCity;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstantSiteMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an instant test task.
 *
 * @description You can create an instant test task only by using the Alibaba Cloud account that you used to enable Network Analysis and Monitoring. 
 * This topic provides an example to show how to create an instant test task. The name of the task is `task1`. The tested address is `http://www.aliyun.com`. The test type is `HTTP`. The number of detection points is `1`.
 *
 * @param request CreateInstantSiteMonitorRequest
 * @return CreateInstantSiteMonitorResponse
 */
async function createInstantSiteMonitor(request: CreateInstantSiteMonitorRequest): CreateInstantSiteMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstantSiteMonitorWithOptions(request, runtime);
}

model CreateMetricRuleBlackListRequest {
  category?: string(name='Category', description='The category of the cloud service. For example, ApsaraDB for Redis includes the following categories: ApsaraDB for Redis (standard architecture), ApsaraDB for Redis (cluster architecture), and ApsaraDB for Redis (read/write splitting architecture). In this case, the valid values of this parameter for ApsaraDB for Redis include `kvstore_standard`, `kvstore_sharding`, and `kvstore_splitrw`.

This parameter is required.', example='ecs'),
  effectiveTime?: string(name='EffectiveTime', description='The time range within which the blacklist policy is effective.

*   If you do not configure this parameter, the blacklist policy is permanently effective.

*   If you configure this parameter, the blacklist policy is effective only within the specified time range. Examples:

    *   `03:00-04:59`: The blacklist policy is effective from 03:00 to 05:00 local time. 05:00 local time is excluded.
    *   `03:00-04:59 UTC+0700`: The blacklist policy is effective from 03:00 to 05:00 (UTC+7). 05:00 (UTC+7) is excluded.', example='03:00-04:59'),
  enableEndTime?: string(name='EnableEndTime', description='The timestamp when the blacklist policy expires.

Unit: milliseconds.', example='1640608200000'),
  enableStartTime?: string(name='EnableStartTime', description='The timestamp when the blacklist policy starts to take effect.

Unit: milliseconds.', example='1640237400000'),
  instances?: [ string ](name='Instances', description='The IDs of the instances that belong to the specified cloud service.

This parameter is required.'),
  metrics?: [ 
    {
      metricName?: string(name='MetricName', description='The metric name.

Valid values of N: 1 to 10.

This parameter is required.', example='disk_utilization'),
      resource?: string(name='Resource', description='The extended dimension of the instance. For example, `{"device":"C:"}` specifies that the blacklist policy is applied to all C disks of the specified Elastic Compute Service (ECS) instance.

Valid values of N: 1 to 10.', example='{"device":"C:"}'),
    }
  ](name='Metrics', description='The metrics of the instance.

*   If you do not configure this parameter, the blacklist policy applies to all metrics of the specified cloud service.
*   If you configure this parameter, the blacklist policy applies only to the current metric.'),
  name?: string(name='Name', description='The name of the blacklist policy.

This parameter is required.', example='Blacklist-01'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  regionId?: string(name='RegionId'),
  scopeType?: string(name='ScopeType', description='The effective scope of the blacklist policy. Valid values:

*   USER (default): The blacklist policy takes effect only for the current Alibaba Cloud account.
*   GROUP: The blacklist policy takes effect only for the specified application group. For information about how to query the IDs of application groups, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='USER'),
  scopeValue?: string(name='ScopeValue', description='The ID of the application group. The value of this parameter is a JSON array.

> This parameter must be specified when `ScopeType` is set to `GROUP`.', example='["67****","78****"]'),
}

model CreateMetricRuleBlackListResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  id?: string(name='Id', description='The ID of the blacklist policy.', example='93514c96-ceb8-47d8-8ee3-93b6d98b****'),
  message?: string(name='Message', description='The error message.', example='The request has failed due to a temporary failure of the server.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5C637FA3-3959-3352-8BE6-78CE2ED2D33D'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateMetricRuleBlackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMetricRuleBlackListResponseBody(name='body'),
}

/**
 * @summary Creates a blacklist policy.
 *
 * @description ### Background information
 * *   CloudMonitor blocks alert notifications based on the blacklist policies that take effect. To block alert notifications when the value of a metric that belongs to a cloud service reaches the threshold that you specified, add the metric to a blacklist policy.
 * *   CloudMonitor allows you to create blacklist policies only based on threshold metrics. You cannot create blacklist policies based on system events. For more information about the cloud services and the thresholds of the metrics that are supported by CloudMonitor, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).
 *
 * @param request CreateMetricRuleBlackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMetricRuleBlackListResponse
 */
async function createMetricRuleBlackListWithOptions(request: CreateMetricRuleBlackListRequest, runtime: Util.RuntimeOptions): CreateMetricRuleBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.enableEndTime)) {
    query['EnableEndTime'] = request.enableEndTime;
  }
  if (!Util.isUnset(request.enableStartTime)) {
    query['EnableStartTime'] = request.enableStartTime;
  }
  if (!Util.isUnset(request.instances)) {
    query['Instances'] = request.instances;
  }
  if (!Util.isUnset(request.metrics)) {
    query['Metrics'] = request.metrics;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.scopeType)) {
    query['ScopeType'] = request.scopeType;
  }
  if (!Util.isUnset(request.scopeValue)) {
    query['ScopeValue'] = request.scopeValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMetricRuleBlackList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a blacklist policy.
 *
 * @description ### Background information
 * *   CloudMonitor blocks alert notifications based on the blacklist policies that take effect. To block alert notifications when the value of a metric that belongs to a cloud service reaches the threshold that you specified, add the metric to a blacklist policy.
 * *   CloudMonitor allows you to create blacklist policies only based on threshold metrics. You cannot create blacklist policies based on system events. For more information about the cloud services and the thresholds of the metrics that are supported by CloudMonitor, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).
 *
 * @param request CreateMetricRuleBlackListRequest
 * @return CreateMetricRuleBlackListResponse
 */
async function createMetricRuleBlackList(request: CreateMetricRuleBlackListRequest): CreateMetricRuleBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMetricRuleBlackListWithOptions(request, runtime);
}

model CreateMetricRuleResourcesRequest {
  overwrite?: string(name='Overwrite', description='Specifies whether to overwrite existing resources. Valid values:

*   true: The resources submitted this time overwrite the previously associated resources.
*   false: The resources submitted this time do not overwrite the previously associated resources. The associated resources after submission include the previously associated resources and the resources submitted this time.', example='false'),
  resources?: string(name='Resources', description='The resources that are associated with the alert rule. Set the value to a JSON array.

>  You can add up to 100 resources each time. An alert rule can be associated with up to 3,000 resources.

This parameter is required.', example='[{"instanceId":"i-a2d5q7pm3f9yr29e****"}]'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='i-2ze3w55tr2rcpejpcfap_59c96b85-0339-4f35-ba66-ae4e34d3****'),
}

model CreateMetricRuleResourcesResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='0671A721-0D7A-4F11-BB77-2416325D65AB'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: true: The request was successful. false: The request failed.', example='true'),
}

model CreateMetricRuleResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMetricRuleResourcesResponseBody(name='body'),
}

/**
 * @summary Associates resources with an alert rule.
 *
 * @param request CreateMetricRuleResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMetricRuleResourcesResponse
 */
async function createMetricRuleResourcesWithOptions(request: CreateMetricRuleResourcesRequest, runtime: Util.RuntimeOptions): CreateMetricRuleResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.overwrite)) {
    query['Overwrite'] = request.overwrite;
  }
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMetricRuleResources',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Associates resources with an alert rule.
 *
 * @param request CreateMetricRuleResourcesRequest
 * @return CreateMetricRuleResourcesResponse
 */
async function createMetricRuleResources(request: CreateMetricRuleResourcesRequest): CreateMetricRuleResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMetricRuleResourcesWithOptions(request, runtime);
}

model CreateMetricRuleTemplateRequest {
  alertTemplates?: [ 
    {
      escalations?: {
        critical?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Critical'),
        info?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Info'),
        warn?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Warn'),
      }(name='Escalations'),
      category?: string(name='Category', description='The abbreviation of the Alibaba Cloud service name.

To obtain the abbreviation of an Alibaba Cloud service name, call the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation. The `metricCategory` tag in the `Labels` response parameter indicates the abbreviation of the Alibaba Cloud service name.

This parameter is required.', example='ecs'),
      metricName?: string(name='MetricName', description='The name of the metric. Valid values of N: 1 to 200.

>  For more information, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/28619.html).

This parameter is required.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service. Valid values of N: 1 to 200.

>  For more information, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/28619.html).

This parameter is required.', example='acs_ecs_dashboard'),
      period?: int32(name='Period', description='The aggregation period of monitoring data. Unit: seconds.

The default value is the minimum aggregation period. Generally, you do not need to specify the minimum aggregation period.

Valid values of N: 1 to 200.', example='60'),
      ruleName?: string(name='RuleName', description='The name of the alert rule. Valid values of N: 1 to 200.

This parameter is required.'),
      selector?: string(name='Selector', description='The extended field selectors. Valid values of N: 1 to 200.', example='{"disk":"/"}'),
      webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='http://ww.aliyun.com'),
    }
  ](name='AlertTemplates'),
  description?: string(name='Description', description='The description of the alert template.', example='ECS_Template1'),
  name?: string(name='Name', description='The name of the alert template.

This parameter is required.', example='Template1'),
  regionId?: string(name='RegionId'),
}

model CreateMetricRuleTemplateResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  id?: long(name='Id', description='The ID of the alert template.', example='12345'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='9763ED1A-4D09-41BF-851E-310421750204'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model CreateMetricRuleTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMetricRuleTemplateResponseBody(name='body'),
}

/**
 * @summary Creates an alert template.
 *
 * @param request CreateMetricRuleTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMetricRuleTemplateResponse
 */
async function createMetricRuleTemplateWithOptions(request: CreateMetricRuleTemplateRequest, runtime: Util.RuntimeOptions): CreateMetricRuleTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertTemplates)) {
    query['AlertTemplates'] = request.alertTemplates;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMetricRuleTemplate',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an alert template.
 *
 * @param request CreateMetricRuleTemplateRequest
 * @return CreateMetricRuleTemplateResponse
 */
async function createMetricRuleTemplate(request: CreateMetricRuleTemplateRequest): CreateMetricRuleTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMetricRuleTemplateWithOptions(request, runtime);
}

model CreateMonitorAgentProcessRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='i-2ze2d6j5uhg20x47****'),
  processName?: string(name='ProcessName', description='The name of the process.

This parameter is required.', example='AliYunDun'),
  processUser?: string(name='ProcessUser', description='The user who launches the process.', example='admin'),
  regionId?: string(name='RegionId'),
}

model CreateMonitorAgentProcessResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  id?: long(name='Id', description='The ID of the process.', example='123456'),
  message?: string(name='Message', description='The error message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='971CC023-5A96-452A-BB7C-2483F948BCFD'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model CreateMonitorAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitorAgentProcessResponseBody(name='body'),
}

/**
 * @summary Creates a task to monitor a process.
 *
 * @param request CreateMonitorAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitorAgentProcessResponse
 */
async function createMonitorAgentProcessWithOptions(request: CreateMonitorAgentProcessRequest, runtime: Util.RuntimeOptions): CreateMonitorAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.processName)) {
    query['ProcessName'] = request.processName;
  }
  if (!Util.isUnset(request.processUser)) {
    query['ProcessUser'] = request.processUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitorAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a task to monitor a process.
 *
 * @param request CreateMonitorAgentProcessRequest
 * @return CreateMonitorAgentProcessResponse
 */
async function createMonitorAgentProcess(request: CreateMonitorAgentProcessRequest): CreateMonitorAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitorAgentProcessWithOptions(request, runtime);
}

model CreateMonitorGroupRequest {
  contactGroups?: string(name='ContactGroups', description='The alert contact group. The alert notifications of the application group are sent to the alert contacts that belong to the alert contact group.

>  An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see [PutContact](~~PutContact~~) and [PutContactGroup](~~PutContactGroup~~).', example='ECS_Alert_Group'),
  groupName?: string(name='GroupName', description='The name of the application group.

This parameter is required.', example='ECS_Group'),
  regionId?: string(name='RegionId'),
}

model CreateMonitorGroupResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  groupId?: long(name='GroupId', description='The ID of the application group.', example='1234567'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='83C89BA6-ABD4-4398-A175-83E86C47A001'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateMonitorGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitorGroupResponseBody(name='body'),
}

/**
 * @summary Creates an application group.
 *
 * @description In this example, an application group named `ECS_Group` is created.
 *
 * @param request CreateMonitorGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitorGroupResponse
 */
async function createMonitorGroupWithOptions(request: CreateMonitorGroupRequest, runtime: Util.RuntimeOptions): CreateMonitorGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitorGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application group.
 *
 * @description In this example, an application group named `ECS_Group` is created.
 *
 * @param request CreateMonitorGroupRequest
 * @return CreateMonitorGroupResponse
 */
async function createMonitorGroup(request: CreateMonitorGroupRequest): CreateMonitorGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitorGroupWithOptions(request, runtime);
}

model CreateMonitorGroupByResourceGroupIdRequest {
  contactGroupList?: [ string ](name='ContactGroupList', description='The alert contact groups. The alert notifications of the application group are sent to the alert contacts that belong to the specified alert contact groups.

An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see [PutContact](https://help.aliyun.com/document_detail/114923.html) and [PutContactGroup](https://help.aliyun.com/document_detail/114929.html). For information about how to obtain alert contact groups, see [DescribeContactGroupList](https://help.aliyun.com/document_detail/114922.html).

This parameter is required.', example='ECS_Group'),
  enableInstallAgent?: boolean(name='EnableInstallAgent', description='Specifies whether the CloudMonitor agent is automatically installed for the application group. CloudMonitor determines whether to automatically install the CloudMonitor agent for the hosts in an application group based on the value of this parameter. Valid values:

*   true: The CloudMonitor agent is automatically installed.
*   false (default): The CloudMonitor agent is not automatically installed.', example='true'),
  enableSubscribeEvent?: boolean(name='EnableSubscribeEvent', description='Specifies whether the application group automatically subscribes to event notifications. If events whose severity level is critical or warning occur on resources in an application group, CloudMonitor sends alert notifications. Valid values:

*   true: The application group automatically subscribes to event notifications.
*   false (default): The application group does not automatically subscribe to event notifications.', example='true'),
  regionId?: string(name='RegionId', description='The ID of the region where the resource group resides.

For information about how to obtain the ID of the region where a resource group resides, see [GetResourceGroup](https://help.aliyun.com/document_detail/158866.html).

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.

For information about how to obtain the ID of a resource group, see [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html).

This parameter is required.', example='rg-acfmw3ty5y7****'),
  resourceGroupName?: string(name='ResourceGroupName', description='The name of the resource group.

For information about how to obtain the name of a resource group, see [ListResourceGroups](https://help.aliyun.com/document_detail/158855.html).

This parameter is required.', example='CloudMonitor'),
}

model CreateMonitorGroupByResourceGroupIdResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  id?: long(name='Id', description='The ID of the application group.', example='3607****'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='784CAB3C-F613-5BCE-8469-6DCB29B18A20'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateMonitorGroupByResourceGroupIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitorGroupByResourceGroupIdResponseBody(name='body'),
}

/**
 * @summary Creates an application group by using a resource group.
 *
 * @description This topic provides an example on how to create an application group by using the resource group `CloudMonitor` and the alert contact group `ECS_Group`. The region ID of the resource group is `cn-hangzhou`.
 *
 * @param request CreateMonitorGroupByResourceGroupIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitorGroupByResourceGroupIdResponse
 */
async function createMonitorGroupByResourceGroupIdWithOptions(request: CreateMonitorGroupByResourceGroupIdRequest, runtime: Util.RuntimeOptions): CreateMonitorGroupByResourceGroupIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroupList)) {
    query['ContactGroupList'] = request.contactGroupList;
  }
  if (!Util.isUnset(request.enableInstallAgent)) {
    query['EnableInstallAgent'] = request.enableInstallAgent;
  }
  if (!Util.isUnset(request.enableSubscribeEvent)) {
    query['EnableSubscribeEvent'] = request.enableSubscribeEvent;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceGroupName)) {
    query['ResourceGroupName'] = request.resourceGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitorGroupByResourceGroupId',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates an application group by using a resource group.
 *
 * @description This topic provides an example on how to create an application group by using the resource group `CloudMonitor` and the alert contact group `ECS_Group`. The region ID of the resource group is `cn-hangzhou`.
 *
 * @param request CreateMonitorGroupByResourceGroupIdRequest
 * @return CreateMonitorGroupByResourceGroupIdResponse
 */
async function createMonitorGroupByResourceGroupId(request: CreateMonitorGroupByResourceGroupIdRequest): CreateMonitorGroupByResourceGroupIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitorGroupByResourceGroupIdWithOptions(request, runtime);
}

model CreateMonitorGroupInstancesRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='3607****'),
  instances?: [ 
    {
      category?: string(name='Category', description='The abbreviation of the Alibaba Cloud service name.

To obtain the abbreviation of an Alibaba Cloud service name, call the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation. The `metricCategory` tag in the `Labels` response parameter indicates the abbreviation of the Alibaba Cloud service name.

This parameter is required.', example='ecs'),
      instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='i-2ze26xj5wwy12****'),
      instanceName?: string(name='InstanceName', description='The instance name.

This parameter is required.', example='test-instance-ecs'),
      regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
    }
  ](name='Instances', description='The instances that you want to add to the application group.

This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model CreateMonitorGroupInstancesResponseBody = {
  code?: int32(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1BC69FEB-56CD-4555-A0E2-02536A24A946'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateMonitorGroupInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitorGroupInstancesResponseBody(name='body'),
}

/**
 * @summary Adds resources to an application group.
 *
 * @description You can add a maximum of 1,000 instances to an application group at a time. You can add a maximum of 3,000 instances of an Alibaba Cloud service to an application group. The total number of instances that you can add to an application group is unlimited.
 * In this example, an Elastic Compute Service (ECS) instance in the `China (Hangzhou)` region is added to the `3607****` application group. The instance ID is `i-2ze26xj5wwy12****` and the instance name is `test-instance-ecs`.
 *
 * @param request CreateMonitorGroupInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitorGroupInstancesResponse
 */
async function createMonitorGroupInstancesWithOptions(request: CreateMonitorGroupInstancesRequest, runtime: Util.RuntimeOptions): CreateMonitorGroupInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instances)) {
    query['Instances'] = request.instances;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitorGroupInstances',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds resources to an application group.
 *
 * @description You can add a maximum of 1,000 instances to an application group at a time. You can add a maximum of 3,000 instances of an Alibaba Cloud service to an application group. The total number of instances that you can add to an application group is unlimited.
 * In this example, an Elastic Compute Service (ECS) instance in the `China (Hangzhou)` region is added to the `3607****` application group. The instance ID is `i-2ze26xj5wwy12****` and the instance name is `test-instance-ecs`.
 *
 * @param request CreateMonitorGroupInstancesRequest
 * @return CreateMonitorGroupInstancesResponse
 */
async function createMonitorGroupInstances(request: CreateMonitorGroupInstancesRequest): CreateMonitorGroupInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitorGroupInstancesWithOptions(request, runtime);
}

model CreateMonitorGroupNotifyPolicyRequest {
  endTime?: long(name='EndTime', description='The timestamp that indicates the end time of the validity period for the policy.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1623208500000'),
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='7301****'),
  policyType?: string(name='PolicyType', description='The type of the policy. Valid value: PauseNotify.

This parameter is required.', example='PauseNotify'),
  regionId?: string(name='RegionId'),
  startTime?: long(name='StartTime', description='The timestamp that indicates the start time of the validity period for the policy.

This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

This parameter is required.', example='1622949300000'),
}

model CreateMonitorGroupNotifyPolicyResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The HTTP status code 200 indicates that the call succeeds.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='13356BCA-3EC3-4748-A771-2064DA69AEF1'),
  result?: int32(name='Result', description='The number of entries that are returned.', example='1'),
  success?: string(name='Success', description='Indicates whether the call succeeds. Valid values:

*   true: The call succeeds.
*   false: The call fails.', example='true'),
}

model CreateMonitorGroupNotifyPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitorGroupNotifyPolicyResponseBody(name='body'),
}

/**
 * @summary Creates a policy to pause alert notifications for an application group.
 *
 * @description If the policy is valid, no alert notifications are sent for the application group.
 * This topic describes how to create the `PauseNotify` policy to pause alert notifications for the `7301****` application group. The StartTime parameter is set to `1622949300000` and the EndTime parameter is set to `1623208500000`. This indicates that the policy is valid from `2021-06-06 11:15:00 UTC+8` to `2021-06-09 11:15:00 UTC+8`.
 *
 * @param request CreateMonitorGroupNotifyPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitorGroupNotifyPolicyResponse
 */
async function createMonitorGroupNotifyPolicyWithOptions(request: CreateMonitorGroupNotifyPolicyRequest, runtime: Util.RuntimeOptions): CreateMonitorGroupNotifyPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.policyType)) {
    query['PolicyType'] = request.policyType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitorGroupNotifyPolicy',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a policy to pause alert notifications for an application group.
 *
 * @description If the policy is valid, no alert notifications are sent for the application group.
 * This topic describes how to create the `PauseNotify` policy to pause alert notifications for the `7301****` application group. The StartTime parameter is set to `1622949300000` and the EndTime parameter is set to `1623208500000`. This indicates that the policy is valid from `2021-06-06 11:15:00 UTC+8` to `2021-06-09 11:15:00 UTC+8`.
 *
 * @param request CreateMonitorGroupNotifyPolicyRequest
 * @return CreateMonitorGroupNotifyPolicyResponse
 */
async function createMonitorGroupNotifyPolicy(request: CreateMonitorGroupNotifyPolicyRequest): CreateMonitorGroupNotifyPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitorGroupNotifyPolicyWithOptions(request, runtime);
}

model CreateMonitoringAgentProcessRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='i-2ze51wjtwox01r8g****'),
  processName?: string(name='ProcessName', description='The name of the process.', example='java'),
  processUser?: string(name='ProcessUser', description='The user who launches the process.', example='admin'),
  regionId?: string(name='RegionId'),
}

model CreateMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  id?: long(name='Id', description='The ID of the process.', example='12345'),
  message?: string(name='Message', description='The error message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0DFCB47D-E7E1-4CBE-A381-8339F7B300EF'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model CreateMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @summary Creates a task to monitor a specified process.
 *
 * @param request CreateMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMonitoringAgentProcessResponse
 */
async function createMonitoringAgentProcessWithOptions(request: CreateMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): CreateMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.processName)) {
    query['ProcessName'] = request.processName;
  }
  if (!Util.isUnset(request.processUser)) {
    query['ProcessUser'] = request.processUser;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a task to monitor a specified process.
 *
 * @param request CreateMonitoringAgentProcessRequest
 * @return CreateMonitoringAgentProcessResponse
 */
async function createMonitoringAgentProcess(request: CreateMonitoringAgentProcessRequest): CreateMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMonitoringAgentProcessWithOptions(request, runtime);
}

model CreateSiteMonitorRequest {
  address?: string(name='Address', description='The URL or IP address that is monitored by the task.

This parameter is required.', example='https://www.aliyun.com'),
  alertIds?: string(name='AlertIds', description='The ID of the alert rule.

For more information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='SystemDefault_acs_ecs_dashboard_InternetOutRate_Percent'),
  customSchedule?: string(name='CustomSchedule', description='The custom detection period. You can only select a time period from Monday to Sunday for detection.', example='{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"}'),
  interval?: string(name='Interval', description='The interval at which detection requests are sent.

Valid values: 1, 5, 15, 30, and 60. Unit: minutes.

Default value: 1.', example='1'),
  ispCities?: string(name='IspCities', description='The information of the detection points. If you leave this parameter empty, the system randomly selects three detection points.

The value is a JSON array. Example: `[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]`. The values of the city field indicate Beijing, Hangzhou, and Qingdao.

For information about how to obtain detection points, see [DescribeSiteMonitorISPCityList](https://help.aliyun.com/document_detail/115045.html).', example='[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the protocol that is used by the site monitoring task. The options vary based on the protocol.', example='{"time_out":5000}'),
  regionId?: string(name='RegionId'),
  taskName?: string(name='TaskName', description='The name of the site monitoring task.

The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_).

This parameter is required.', example='HanZhou_ECS1'),
  taskType?: string(name='TaskType', description='The protocol that is used by the site monitoring task.

Valid values: HTTP, HTTPS, PING, TCP, UDP, DNS, SMTP, POP3, FTP, and WEBSOCKET.

This parameter is required.', example='HTTPS'),
  vpcConfig?: string(name='VpcConfig'),
}

model CreateSiteMonitorResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  createResultList?: {
    createResultList?: [ 
    {
      taskId?: string(name='TaskId', description='The ID of the site monitoring task.', example='2c8dbdf9-a3ab-46a1-85a4-f094965e****'),
      taskName?: string(name='TaskName', description='The name of the site monitoring task.', example='HanZhou_ECS1'),
    }
  ](name='CreateResultList')
  }(name='CreateResultList', description='The returned result.

If a site monitoring task is created, the result is returned. If a site monitoring task fails to be created, no result is returned.'),
  data?: {
    attachAlertResult?: {
      contact?: [ 
      {
        code?: string(name='Code', description='The status code that is returned after you associate the existing alert rule with the site monitoring task.

>  The status code 200 indicates that the request was successful.', example='200'),
        message?: string(name='Message', description='The message that is returned after you associate the existing alert rule with the site monitoring task.', example='successful'),
        requestId?: string(name='RequestId', description='The ID of the request that was sent to associate the existing alert rule with the site monitoring task.', example='5dd33455-4f65-4b0c-9200-33d66f3f340b'),
        ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='SystemDefault_acs_ecs_dashboard_InternetOutRate_Percent'),
        success?: string(name='Success', description='Indicates whether the existing alert rule was associated with the site monitoring task. Valid values:

*   true
*   false', example='true'),
      }
    ](name='Contact')
    }(name='AttachAlertResult', description='The result that is returned after you associate the existing alert rule with the site monitoring task.'),
  }(name='Data', description='The result of the site monitoring task.'),
  message?: string(name='Message', description='The returned message.', example='Successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='68192f5d-0d45-4b98-9724-892813f86c71'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CreateSiteMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSiteMonitorResponseBody(name='body'),
}

/**
 * @summary Creates a site monitoring task.
 *
 * @description This topic provides an example on how to create a site monitoring task named `HanZhou_ECS1`. The URL that is monitored by the task is `https://www.aliyun.com` and the type of the task is `HTTPS`.
 *
 * @param request CreateSiteMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSiteMonitorResponse
 */
async function createSiteMonitorWithOptions(request: CreateSiteMonitorRequest, runtime: Util.RuntimeOptions): CreateSiteMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.alertIds)) {
    query['AlertIds'] = request.alertIds;
  }
  if (!Util.isUnset(request.customSchedule)) {
    query['CustomSchedule'] = request.customSchedule;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.ispCities)) {
    query['IspCities'] = request.ispCities;
  }
  if (!Util.isUnset(request.optionsJson)) {
    query['OptionsJson'] = request.optionsJson;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  if (!Util.isUnset(request.vpcConfig)) {
    query['VpcConfig'] = request.vpcConfig;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSiteMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a site monitoring task.
 *
 * @description This topic provides an example on how to create a site monitoring task named `HanZhou_ECS1`. The URL that is monitored by the task is `https://www.aliyun.com` and the type of the task is `HTTPS`.
 *
 * @param request CreateSiteMonitorRequest
 * @return CreateSiteMonitorResponse
 */
async function createSiteMonitor(request: CreateSiteMonitorRequest): CreateSiteMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSiteMonitorWithOptions(request, runtime);
}

model CursorRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

Unit: milliseconds.

> 

*   This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2023-01-01T00:00:00Z indicates January 1, 2023, 00:00:00 UTC.

*   If you do not set the end time, the end time is infinite. You can leave this parameter empty in real-time export scenarios.
*   In CloudMonitor, the TTL of monitoring data varies with the time granularity. Specify a proper time interval based on the TTL corresponding to the value of the `Period` parameter.', example='1641645000000'),
  matchers?: [
    Matcher
  ](name='Matchers', description='The dimension information of the metric.'),
  metric?: string(name='Metric', description='The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  period?: int32(name='Period', description='The time interval based on which the metric value is measured.

Unit: seconds.

>  Generally, the time interval is 60 seconds. For more information about specific values, see the `Period` parameter in [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='60'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2023-01-01T00:00:00Z indicates January 1, 2023, 00:00:00 UTC.

>  In CloudMonitor, the TTL of monitoring data varies with the time granularity. Specify a proper time interval based on the TTL corresponding to the value of the `Period` parameter.

This parameter is required.', example='1641627000000'),
}

model CursorShrinkRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

Unit: milliseconds.

> 

*   This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2023-01-01T00:00:00Z indicates January 1, 2023, 00:00:00 UTC.

*   If you do not set the end time, the end time is infinite. You can leave this parameter empty in real-time export scenarios.
*   In CloudMonitor, the TTL of monitoring data varies with the time granularity. Specify a proper time interval based on the TTL corresponding to the value of the `Period` parameter.', example='1641645000000'),
  matchersShrink?: string(name='Matchers', description='The dimension information of the metric.'),
  metric?: string(name='Metric', description='The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  period?: int32(name='Period', description='The time interval based on which the metric value is measured.

Unit: seconds.

>  Generally, the time interval is 60 seconds. For more information about specific values, see the `Period` parameter in [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='60'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. For example, 2023-01-01T00:00:00Z indicates January 1, 2023, 00:00:00 UTC.

>  In CloudMonitor, the TTL of monitoring data varies with the time granularity. Specify a proper time interval based on the TTL corresponding to the value of the `Period` parameter.

This parameter is required.', example='1641627000000'),
}

model CursorResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  cursor?: string(name='Cursor', description='Cursor is used as an input parameter for data export in the [BatchExport](https://help.aliyun.com/document_detail/2329847.html) operation.', example='v2.5eyJiYXRjaGVzIjoxLCJidWNrZXRCeXRlcyI6IndBPT0iLCJidWNrZXRzIjo0LCJjdXJyZW50QnVja2V0IjotNjQsImN1cnJlbnRUYXJnZXRUaW1lU2xvdCI6MTY3ODc1MjAwMCwiZW5kVGltZSI6MTY3ODc4MjQxOTAwMCwiZXhwb3J0RW5kVGltZSI6MTY3ODc4MjQxOTAwMCwiZXhwb3J0U3RhcnRUaW1lIjoxNjc4NzgxODE5MDAwLCJleHByZXNzUmFuZ2UiOmZhbHNlLCJoYXNOZXh0Ijp0cnVlLCJpbmRleCI6MCwibGF0ZXN0TG9nVGltZSI6MCwibWF0Y2hlcnMiOnsiY2hhaW4iOlt7ImxhYmVsIjoidXNlcklkIiwib3BlcmF0b3IiOiJFUVVBTFMiLCJ2YWx1ZSI6IjEyNzA2NzY2Nzk1NDY3MDQifV0sImxvY2tlZCI6dHJ1ZX0sIm1ldHJpYyI6IlNwbGl0cndQcm94eU1heFJlc3BvbnNlU2l6ZSIsIm1ldHJpY1R5cGUiOiJNRVRSSUMiLCJuYW1lc3BhY2UiOiJhY3Nfa3ZzdG9yZV9leCIsIm5leHRQa0FkYXB0ZXIiOnsiZGltIjoiVjowXG5EOmB1c2VySWRgPTEyNzA2NzY2Nzk1NDY3MDQsYGluc3RhbmNlSWRgPXItcmo5ZjlzMTlsc3V1MXd1bnVyLGBub2RlSWRgPXItcmo5ZjlzMTlsc3V1MXd1bnVyLXByb3h5LTIsXG4iLCJtZXRhIjoiXG5WOjBcbk06YWNzX2t2c3RvcmVfZXgvU3BsaXRyd1Byb3h5TWF4UmVzcG9uc2VTaXplXG5XOjYwXG5COjRcbkk6LTFcblQ6MFxuQzpgQXZlcmFnZWAsYE1heGltdW1gLGBfX2NvdW50X19gLGBfX3RzX19gXG4iLCJyZCI6InN1YkFMU0RwWXY2K0t6aENQQUFBWkErNUFKMEpjbGErRGd2V0hFNWxDSHMvbGtqR2FXYTFJTkVwdFE9PSIsInRhZyI6IiJ9LCJvZmZzZXQiOjAsIm9mZnNldERpZ2l0Ijo0NTU0NTczNDQyMTc4NDIxMjIsInN0YXJ0VGltZSI6MTY3ODc4MTgxOTAwMCwic3RlcCI6LTEsInRhZ01hdGNoZXJzIjp7ImNoYWluIjpbXSwibG9ja2VkIjp0cnVlfSwidGFyZ2V0VGltZVNsb3RzIjpbMTY3ODY2NTYwMCwxNjc4NzUyMDAwXSwidXVpZCI6ImQwMmFhZmY1LWU3ZGQtNDUyYy0***********'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='915C2D7A-E6A4-17C3-8E13-4DBDD61E7919'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model CursorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CursorResponseBody(name='body'),
}

/**
 * @summary Defines the range of monitoring data that you want to export. The Cursor information is returned. When you call the BatchExport operation for the first time, you must specify the Cursor information.
 *
 * @description ### [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * ### [](#)Background information
 * You can call this operation to obtain the Cursor information and then call the [BatchExport](https://help.aliyun.com/document_detail/2329847.html) operation to export the monitoring data.
 * ### [](#)Description
 * This topic provides an example on how to define the monitoring data of a specified metric for a specified cloud service. In this example, the namespace of the cloud service is set to `acs_ecs_dashboard`, the metric is set to `cpu_idle`, the start time is set to `1641627000000`, and the end time is set to `1641645000000`. The number of idle CPU cores on your Elastic Compute Service (ECS) instances is measured every 60 seconds from 15:30:00, January 8, 2022 to 20:30:00, January 8, 2022. The `Cursor` information is returned.
 *
 * @param tmpReq CursorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CursorResponse
 */
async function cursorWithOptions(tmpReq: CursorRequest, runtime: Util.RuntimeOptions): CursorResponse {
  Util.validateModel(tmpReq);
  var request = new CursorShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.matchers)) {
    request.matchersShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.matchers, 'Matchers', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.matchersShrink)) {
    body['Matchers'] = request.matchersShrink;
  }
  if (!Util.isUnset(request.metric)) {
    body['Metric'] = request.metric;
  }
  if (!Util.isUnset(request.namespace)) {
    body['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.period)) {
    body['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Cursor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Defines the range of monitoring data that you want to export. The Cursor information is returned. When you call the BatchExport operation for the first time, you must specify the Cursor information.
 *
 * @description ### [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * ### [](#)Background information
 * You can call this operation to obtain the Cursor information and then call the [BatchExport](https://help.aliyun.com/document_detail/2329847.html) operation to export the monitoring data.
 * ### [](#)Description
 * This topic provides an example on how to define the monitoring data of a specified metric for a specified cloud service. In this example, the namespace of the cloud service is set to `acs_ecs_dashboard`, the metric is set to `cpu_idle`, the start time is set to `1641627000000`, and the end time is set to `1641645000000`. The number of idle CPU cores on your Elastic Compute Service (ECS) instances is measured every 60 seconds from 15:30:00, January 8, 2022 to 20:30:00, January 8, 2022. The `Cursor` information is returned.
 *
 * @param request CursorRequest
 * @return CursorResponse
 */
async function cursor(request: CursorRequest): CursorResponse {
  var runtime = new Util.RuntimeOptions{};
  return cursorWithOptions(request, runtime);
}

model DeleteContactRequest {
  contactName?: string(name='ContactName', description='The name of the alert contact.

This parameter is required.', example='test-01'),
}

model DeleteContactResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='50D4CFE1-01E5-4543-939C-18BC01E3EC1C'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteContactResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteContactResponseBody(name='body'),
}

/**
 * @summary Deletes an alert contact.
 *
 * @param request DeleteContactRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteContactResponse
 */
async function deleteContactWithOptions(request: DeleteContactRequest, runtime: Util.RuntimeOptions): DeleteContactResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteContact',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an alert contact.
 *
 * @param request DeleteContactRequest
 * @return DeleteContactResponse
 */
async function deleteContact(request: DeleteContactRequest): DeleteContactResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteContactWithOptions(request, runtime);
}

model DeleteContactGroupRequest {
  contactGroupName?: string(name='ContactGroupName', description='The name of the alert group.

This parameter is required.', example='contact_group_2019_templatedfkXQ'),
}

model DeleteContactGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F722BE59-2400-4A64-9C1A-AD886AED9A69'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteContactGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteContactGroupResponseBody(name='body'),
}

/**
 * @summary Deletes an alert group.
 *
 * @param request DeleteContactGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteContactGroupResponse
 */
async function deleteContactGroupWithOptions(request: DeleteContactGroupRequest, runtime: Util.RuntimeOptions): DeleteContactGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroupName)) {
    query['ContactGroupName'] = request.contactGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteContactGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an alert group.
 *
 * @param request DeleteContactGroupRequest
 * @return DeleteContactGroupResponse
 */
async function deleteContactGroup(request: DeleteContactGroupRequest): DeleteContactGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteContactGroupWithOptions(request, runtime);
}

model DeleteCustomMetricRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='3607****'),
  md5?: string(name='Md5', description='The MD5 value of the HTTP request body. The MD5 value is a 128-bit hash value used to verify the uniqueness of the reported monitoring data.

>  `Md5` is returned when you query the reported monitoring data of a metric.', example='38796C8CFFEB8F89BB2A626C7BD7****'),
  metricName?: string(name='MetricName', description='The name of the metric.

This parameter is required.', example='AdvanceCredit'),
  regionId?: string(name='RegionId'),
  UUID?: string(name='UUID', description='The ID of the request for reporting monitoring data.

>  `UUID` is returned when you query the reported monitoring data of a metric. We recommend that you specify the `Md5` parameter.', example='5497633c-66c5-4eae-abaa-89db5adb****'),
}

model DeleteCustomMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='05B36C2C-5F6E-48D5-8B41-CE36DD7EE8E0'),
}

model DeleteCustomMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCustomMetricResponseBody(name='body'),
}

/**
 * @summary Deletes the reported monitoring data of a metric.
 *
 * @param request DeleteCustomMetricRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCustomMetricResponse
 */
async function deleteCustomMetricWithOptions(request: DeleteCustomMetricRequest, runtime: Util.RuntimeOptions): DeleteCustomMetricResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.md5)) {
    query['Md5'] = request.md5;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.UUID)) {
    query['UUID'] = request.UUID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomMetric',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the reported monitoring data of a metric.
 *
 * @param request DeleteCustomMetricRequest
 * @return DeleteCustomMetricResponse
 */
async function deleteCustomMetric(request: DeleteCustomMetricRequest): DeleteCustomMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomMetricWithOptions(request, runtime);
}

model DeleteDynamicTagGroupRequest {
  dynamicTagRuleId?: string(name='DynamicTagRuleId', description='The ID of the tag rule.

For information about how to obtain the ID of a tag rule, see [DescribeDynamicTagRuleList](https://help.aliyun.com/document_detail/150126.html).

This parameter is required.', example='6b882d9a-5117-42e2-9d0c-4749a0c6****'),
  regionId?: string(name='RegionId'),
}

model DeleteDynamicTagGroupResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='08AAE67E-77B5-485B-9C79-D7C8C059150A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteDynamicTagGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDynamicTagGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a tag rule.
 *
 * @param request DeleteDynamicTagGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDynamicTagGroupResponse
 */
async function deleteDynamicTagGroupWithOptions(request: DeleteDynamicTagGroupRequest, runtime: Util.RuntimeOptions): DeleteDynamicTagGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dynamicTagRuleId)) {
    query['DynamicTagRuleId'] = request.dynamicTagRuleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDynamicTagGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a tag rule.
 *
 * @param request DeleteDynamicTagGroupRequest
 * @return DeleteDynamicTagGroupResponse
 */
async function deleteDynamicTagGroup(request: DeleteDynamicTagGroupRequest): DeleteDynamicTagGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDynamicTagGroupWithOptions(request, runtime);
}

model DeleteEventRuleTargetsRequest {
  ids?: [ string ](name='Ids', description='The IDs of event-triggered alert rules.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the event-triggered alert rule.

For information about how to obtain the name of an event-triggered alert rule, see [DescribeEventRuleList](https://help.aliyun.com/document_detail/114996.html).

This parameter is required.', example='testRule'),
}

model DeleteEventRuleTargetsResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID. You can use the request ID to query logs and troubleshoot issues.', example='7ADD7EFB-7555-4EC1-A3D9-F9955C189CCF'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
}

model DeleteEventRuleTargetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEventRuleTargetsResponseBody(name='body'),
}

/**
 * @summary Deletes the push channels of an event-triggered alert rule.
 *
 * @param request DeleteEventRuleTargetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEventRuleTargetsResponse
 */
async function deleteEventRuleTargetsWithOptions(request: DeleteEventRuleTargetsRequest, runtime: Util.RuntimeOptions): DeleteEventRuleTargetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEventRuleTargets',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the push channels of an event-triggered alert rule.
 *
 * @param request DeleteEventRuleTargetsRequest
 * @return DeleteEventRuleTargetsResponse
 */
async function deleteEventRuleTargets(request: DeleteEventRuleTargetsRequest): DeleteEventRuleTargetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEventRuleTargetsWithOptions(request, runtime);
}

model DeleteEventRulesRequest {
  ruleNames?: [ string ](name='RuleNames', description='This parameter is required.', example='rule1'),
}

model DeleteEventRulesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5A72B5B-4F44-438C-B68A-147FD5DC53A8'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteEventRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEventRulesResponseBody(name='body'),
}

/**
 * @summary Deletes one or more event-triggered alert rules.
 *
 * @param request DeleteEventRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEventRulesResponse
 */
async function deleteEventRulesWithOptions(request: DeleteEventRulesRequest, runtime: Util.RuntimeOptions): DeleteEventRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleNames)) {
    query['RuleNames'] = request.ruleNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEventRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more event-triggered alert rules.
 *
 * @param request DeleteEventRulesRequest
 * @return DeleteEventRulesResponse
 */
async function deleteEventRules(request: DeleteEventRulesRequest): DeleteEventRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEventRulesWithOptions(request, runtime);
}

model DeleteExporterOutputRequest {
  destName?: string(name='DestName', description='The name of the configuration set.

This parameter is required.', example='testName'),
  regionId?: string(name='RegionId'),
}

model DeleteExporterOutputResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.', example='200'),
  message?: string(name='Message', description='The returned message.', example='Success'),
  requestId?: string(name='RequestId', description='The request ID.', example='2DECF751-7AFA-43BB-8C63-2B6B07E51AE1'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
}

model DeleteExporterOutputResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExporterOutputResponseBody(name='body'),
}

/**
 * @summary Deletes a configuration set that is used to export monitoring data.
 *
 * @param request DeleteExporterOutputRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExporterOutputResponse
 */
async function deleteExporterOutputWithOptions(request: DeleteExporterOutputRequest, runtime: Util.RuntimeOptions): DeleteExporterOutputResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destName)) {
    query['DestName'] = request.destName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExporterOutput',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a configuration set that is used to export monitoring data.
 *
 * @param request DeleteExporterOutputRequest
 * @return DeleteExporterOutputResponse
 */
async function deleteExporterOutput(request: DeleteExporterOutputRequest): DeleteExporterOutputResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteExporterOutputWithOptions(request, runtime);
}

model DeleteExporterRuleRequest {
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the data export rule.

This parameter is required.', example='myRuleName'),
}

model DeleteExporterRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='6A5F022D-AC7C-460E-94AE-B9E75083D023'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
}

model DeleteExporterRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExporterRuleResponseBody(name='body'),
}

/**
 * @summary Deletes a data export rule.
 *
 * @param request DeleteExporterRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExporterRuleResponse
 */
async function deleteExporterRuleWithOptions(request: DeleteExporterRuleRequest, runtime: Util.RuntimeOptions): DeleteExporterRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExporterRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a data export rule.
 *
 * @param request DeleteExporterRuleRequest
 * @return DeleteExporterRuleResponse
 */
async function deleteExporterRule(request: DeleteExporterRuleRequest): DeleteExporterRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteExporterRuleWithOptions(request, runtime);
}

model DeleteGroupMonitoringAgentProcessRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  id?: string(name='Id', description='The ID of the process monitoring task.

This parameter is required.', example='48F83746-C817-478C-9B06-7158F56B****'),
  regionId?: string(name='RegionId'),
}

model DeleteGroupMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3F6150F9-45C7-43F9-9578-A58B2E726C90'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DeleteGroupMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteGroupMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @summary Deletes a process monitoring task for an application group.
 *
 * @param request DeleteGroupMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteGroupMonitoringAgentProcessResponse
 */
async function deleteGroupMonitoringAgentProcessWithOptions(request: DeleteGroupMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): DeleteGroupMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteGroupMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a process monitoring task for an application group.
 *
 * @param request DeleteGroupMonitoringAgentProcessRequest
 * @return DeleteGroupMonitoringAgentProcessResponse
 */
async function deleteGroupMonitoringAgentProcess(request: DeleteGroupMonitoringAgentProcessRequest): DeleteGroupMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteGroupMonitoringAgentProcessWithOptions(request, runtime);
}

model DeleteHostAvailabilityRequest {
  id?: [ long ](name='Id', description='This parameter is required.', example='12456'),
  regionId?: string(name='RegionId'),
}

model DeleteHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='57C782E6-B235-4842-AD2B-DB94961761EB'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHostAvailabilityResponseBody(name='body'),
}

/**
 * @summary Deletes one or more availability monitoring tasks.
 *
 * @param request DeleteHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHostAvailabilityResponse
 */
async function deleteHostAvailabilityWithOptions(request: DeleteHostAvailabilityRequest, runtime: Util.RuntimeOptions): DeleteHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more availability monitoring tasks.
 *
 * @param request DeleteHostAvailabilityRequest
 * @return DeleteHostAvailabilityResponse
 */
async function deleteHostAvailability(request: DeleteHostAvailabilityRequest): DeleteHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHostAvailabilityWithOptions(request, runtime);
}

model DeleteHybridMonitorNamespaceRequest {
  namespace?: string(name='Namespace', description='The name of the namespace.

For information about how to obtain the name of a namespace, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='aliyun'),
  regionId?: string(name='RegionId'),
}

model DeleteHybridMonitorNamespaceResponseBody = {
  code?: string(name='Code', description='The returned message.', example='Success'),
  message?: string(name='Message', description='The error message.', example='Namespace.NotFound'),
  requestId?: string(name='RequestId', description='The request ID.', example='3843D23A-FB9E-5DC8-BCCC-458768B79296'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteHybridMonitorNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHybridMonitorNamespaceResponseBody(name='body'),
}

/**
 * @summary Deletes a namespace.
 *
 * @description > If a metric import task is created for metrics in a namespace, you cannot delete the namespace unless you delete the task first.
 * This topic provides an example on how to delete a namespace named `aliyun`. The response shows that the namespace is deleted.
 *
 * @param request DeleteHybridMonitorNamespaceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHybridMonitorNamespaceResponse
 */
async function deleteHybridMonitorNamespaceWithOptions(request: DeleteHybridMonitorNamespaceRequest, runtime: Util.RuntimeOptions): DeleteHybridMonitorNamespaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHybridMonitorNamespace',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a namespace.
 *
 * @description > If a metric import task is created for metrics in a namespace, you cannot delete the namespace unless you delete the task first.
 * This topic provides an example on how to delete a namespace named `aliyun`. The response shows that the namespace is deleted.
 *
 * @param request DeleteHybridMonitorNamespaceRequest
 * @return DeleteHybridMonitorNamespaceResponse
 */
async function deleteHybridMonitorNamespace(request: DeleteHybridMonitorNamespaceRequest): DeleteHybridMonitorNamespaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHybridMonitorNamespaceWithOptions(request, runtime);
}

model DeleteHybridMonitorSLSGroupRequest {
  regionId?: string(name='RegionId'),
  SLSGroupName?: string(name='SLSGroupName', description='The name of the Logstore group.

For information about how to obtain the name of a Logstore group, see [DescribeHybridMonitorSLSGroup](https://help.aliyun.com/document_detail/429526.html).

This parameter is required.', example='Logstore_test'),
}

model DeleteHybridMonitorSLSGroupResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='RESOURCE_NOT_FOUND'),
  requestId?: string(name='RequestId', description='The request ID.', example='85198BFF-1DE6-556E-B6A4-C77C51C62B8D'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteHybridMonitorSLSGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHybridMonitorSLSGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a Logstore group.
 *
 * @description This topic provides an example on how to delete a Logstore group named `Logstore_test`. The response shows that the Logstore group is deleted.
 *
 * @param request DeleteHybridMonitorSLSGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHybridMonitorSLSGroupResponse
 */
async function deleteHybridMonitorSLSGroupWithOptions(request: DeleteHybridMonitorSLSGroupRequest, runtime: Util.RuntimeOptions): DeleteHybridMonitorSLSGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.SLSGroupName)) {
    query['SLSGroupName'] = request.SLSGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHybridMonitorSLSGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a Logstore group.
 *
 * @description This topic provides an example on how to delete a Logstore group named `Logstore_test`. The response shows that the Logstore group is deleted.
 *
 * @param request DeleteHybridMonitorSLSGroupRequest
 * @return DeleteHybridMonitorSLSGroupResponse
 */
async function deleteHybridMonitorSLSGroup(request: DeleteHybridMonitorSLSGroupRequest): DeleteHybridMonitorSLSGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHybridMonitorSLSGroupWithOptions(request, runtime);
}

model DeleteHybridMonitorTaskRequest {
  namespace?: string(name='Namespace', description='The name of the namespace.

The name can contain uppercase letters, lowercase letters, digits, and hyphens (-).

> This parameter is required only if you call this operation to delete metric import tasks for Alibaba Cloud services. In this case, the `TaskType` parameter is set to `aliyun_fc`.', example='aliyun'),
  regionId?: string(name='RegionId'),
  targetUserId?: string(name='TargetUserId', description='The ID of the member account.

> This parameter is required only if you use a management account to call this operation to query metric import tasks that belong to a member in a resource directory. In this case, the `TaskType` parameter is set to `aliyun_fc`.', example='120886317861****'),
  taskId?: string(name='TaskId', description='The ID of the metric import task.

For information about how to obtain the ID of a metric import task, see [DescribeHybridMonitorTaskList](https://help.aliyun.com/document_detail/428624.html).

> This parameter is required only if you call this operation to delete metrics for the logs that are imported from Log Service. In this case, the `TaskType` parameter is set to `aliyun_sls`.', example='36****'),
}

model DeleteHybridMonitorTaskResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='null'),
  requestId?: string(name='RequestId', description='The request ID.', example='D6B8103F-7BAD-5FEB-945F-71D991AB8834'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteHybridMonitorTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHybridMonitorTaskResponseBody(name='body'),
}

/**
 * @summary Deletes a metric import task for Alibaba Cloud services or a metric for the logs that are imported from Log Service.
 *
 * @description This topic provides an example on how to delete a metric import task whose ID is `36****`. The returned result indicates that the metric import task is deleted.
 *
 * @param request DeleteHybridMonitorTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHybridMonitorTaskResponse
 */
async function deleteHybridMonitorTaskWithOptions(request: DeleteHybridMonitorTaskRequest, runtime: Util.RuntimeOptions): DeleteHybridMonitorTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.targetUserId)) {
    query['TargetUserId'] = request.targetUserId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHybridMonitorTask',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a metric import task for Alibaba Cloud services or a metric for the logs that are imported from Log Service.
 *
 * @description This topic provides an example on how to delete a metric import task whose ID is `36****`. The returned result indicates that the metric import task is deleted.
 *
 * @param request DeleteHybridMonitorTaskRequest
 * @return DeleteHybridMonitorTaskResponse
 */
async function deleteHybridMonitorTask(request: DeleteHybridMonitorTaskRequest): DeleteHybridMonitorTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHybridMonitorTaskWithOptions(request, runtime);
}

model DeleteLogMonitorRequest {
  logId?: long(name='LogId', description='The ID returned by Log Service.

This parameter is required.', example='12345'),
  regionId?: string(name='RegionId'),
}

model DeleteLogMonitorResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='metric not exist.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='42BFFC2B-5E4D-4FDE-BCC6-E91EE33C5967'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DeleteLogMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLogMonitorResponseBody(name='body'),
}

/**
 * @summary Deletes a log monitoring metric.
 *
 * @param request DeleteLogMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLogMonitorResponse
 */
async function deleteLogMonitorWithOptions(request: DeleteLogMonitorRequest, runtime: Util.RuntimeOptions): DeleteLogMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.logId)) {
    query['LogId'] = request.logId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLogMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a log monitoring metric.
 *
 * @param request DeleteLogMonitorRequest
 * @return DeleteLogMonitorResponse
 */
async function deleteLogMonitor(request: DeleteLogMonitorRequest): DeleteLogMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteLogMonitorWithOptions(request, runtime);
}

model DeleteMetricRuleBlackListRequest {
  id?: string(name='Id', description='The IDs of the blacklist policies. Separate multiple IDs with commas (,). You can specify up to 50 IDs.

For more information about how to obtain the ID of a blacklist policy, see [DescribeMetricRuleBlackList](https://help.aliyun.com/document_detail/457257.html).

>  You can also set this parameter to a JSON array. Example: `["a9ad2ac2-3ed9-11ed-b878-0242ac12****","5cb8a9a4-198f-4651-a353-f8b28788****"]`.

This parameter is required.', example='a9ad2ac2-3ed9-11ed-b878-0242ac12****'),
  regionId?: string(name='RegionId'),
}

model DeleteMetricRuleBlackListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  count?: int32(name='Count', description='The number of blacklist policies that are deleted.', example='1'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B88D233C-A004-3AB8-AD9C-30CBDD4440C5'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMetricRuleBlackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricRuleBlackListResponseBody(name='body'),
}

/**
 * @summary Deletes multiple blacklist policies at a time.
 *
 * @param request DeleteMetricRuleBlackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricRuleBlackListResponse
 */
async function deleteMetricRuleBlackListWithOptions(request: DeleteMetricRuleBlackListRequest, runtime: Util.RuntimeOptions): DeleteMetricRuleBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricRuleBlackList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes multiple blacklist policies at a time.
 *
 * @param request DeleteMetricRuleBlackListRequest
 * @return DeleteMetricRuleBlackListResponse
 */
async function deleteMetricRuleBlackList(request: DeleteMetricRuleBlackListRequest): DeleteMetricRuleBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMetricRuleBlackListWithOptions(request, runtime);
}

model DeleteMetricRuleResourcesRequest {
  resources?: string(name='Resources', description='The resources that are associated with the alert rule.

This parameter is required.', example='[{"instanceId":"i-uf6hm9lnlzsarrc7****"}]'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

This parameter is required.', example='rr-bp18017n6iolv****'),
}

model DeleteMetricRuleResourcesResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The alert does not exist.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D8A35882-90C6-4F03-BBEB-153C180398EA'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMetricRuleResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricRuleResourcesResponseBody(name='body'),
}

/**
 * @summary Disassociates resources from an alert rule.
 *
 * @param request DeleteMetricRuleResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricRuleResourcesResponse
 */
async function deleteMetricRuleResourcesWithOptions(request: DeleteMetricRuleResourcesRequest, runtime: Util.RuntimeOptions): DeleteMetricRuleResourcesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricRuleResources',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disassociates resources from an alert rule.
 *
 * @param request DeleteMetricRuleResourcesRequest
 * @return DeleteMetricRuleResourcesResponse
 */
async function deleteMetricRuleResources(request: DeleteMetricRuleResourcesRequest): DeleteMetricRuleResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMetricRuleResourcesWithOptions(request, runtime);
}

model DeleteMetricRuleTargetsRequest {
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

This parameter is required.', example='ruleId-xxxxxx'),
  targetIds?: [ string ](name='TargetIds', description='The resource IDs.

This parameter is required.', example='12345'),
}

model DeleteMetricRuleTargetsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

**

**Description** The status code 200 indicates that the request was successful.', example='200'),
  failIds?: {
    targetIds?: {
      targetId?: [ string ](name='TargetId')
    }(name='TargetIds', description='The IDs of the resources that failed to be deleted.'),
  }(name='FailIds', description='The IDs of the resources that failed to be deleted.'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='786E92D2-AC66-4250-B76F-F1E2FCDDBA1C'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMetricRuleTargetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricRuleTargetsResponseBody(name='body'),
}

/**
 * @summary Delete the push channels of an alert rule.
 *
 * @param request DeleteMetricRuleTargetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricRuleTargetsResponse
 */
async function deleteMetricRuleTargetsWithOptions(request: DeleteMetricRuleTargetsRequest, runtime: Util.RuntimeOptions): DeleteMetricRuleTargetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.targetIds)) {
    query['TargetIds'] = request.targetIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricRuleTargets',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Delete the push channels of an alert rule.
 *
 * @param request DeleteMetricRuleTargetsRequest
 * @return DeleteMetricRuleTargetsResponse
 */
async function deleteMetricRuleTargets(request: DeleteMetricRuleTargetsRequest): DeleteMetricRuleTargetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMetricRuleTargetsWithOptions(request, runtime);
}

model DeleteMetricRuleTemplateRequest {
  regionId?: string(name='RegionId'),
  templateId?: string(name='TemplateId', description='The ID of the alert template.

This parameter is required.', example='123****'),
}

model DeleteMetricRuleTemplateResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7B63F8CF-D48D-4608-A402-04FB5B2B4B6A'),
  resource?: {
    templateId?: string(name='TemplateId', description='The ID of the template.', example='123****'),
  }(name='Resource', description='The information about the alert template.'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteMetricRuleTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricRuleTemplateResponseBody(name='body'),
}

/**
 * @summary Deletes an alert template.
 *
 * @param request DeleteMetricRuleTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricRuleTemplateResponse
 */
async function deleteMetricRuleTemplateWithOptions(request: DeleteMetricRuleTemplateRequest, runtime: Util.RuntimeOptions): DeleteMetricRuleTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricRuleTemplate',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an alert template.
 *
 * @param request DeleteMetricRuleTemplateRequest
 * @return DeleteMetricRuleTemplateResponse
 */
async function deleteMetricRuleTemplate(request: DeleteMetricRuleTemplateRequest): DeleteMetricRuleTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMetricRuleTemplateWithOptions(request, runtime);
}

model DeleteMetricRulesRequest {
  id?: [ string ](name='Id', description='This parameter is required.', example='ab05733c97b7ce239fb1b53393dc1697c7e12****'),
  regionId?: string(name='RegionId'),
}

model DeleteMetricRulesResponseBody = {
  code?: string(name='Code', description='The status code.

>  The status code 200 indicates a success.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5599964-8D0D-40DC-8E90-27A619384B81'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   true: successful.
*   false: failed.', example='true'),
}

model DeleteMetricRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMetricRulesResponseBody(name='body'),
}

/**
 * @summary Deletes one or more alert rules.
 *
 * @param request DeleteMetricRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMetricRulesResponse
 */
async function deleteMetricRulesWithOptions(request: DeleteMetricRulesRequest, runtime: Util.RuntimeOptions): DeleteMetricRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMetricRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more alert rules.
 *
 * @param request DeleteMetricRulesRequest
 * @return DeleteMetricRulesResponse
 */
async function deleteMetricRules(request: DeleteMetricRulesRequest): DeleteMetricRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMetricRulesWithOptions(request, runtime);
}

model DeleteMonitorGroupRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model DeleteMonitorGroupResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  group?: {
    contactGroups?: {
      contactGroup?: [ 
      {
        name?: string(name='Name', description='The name of the alert group.', example='ECS_Group'),
      }
    ](name='ContactGroup')
    }(name='ContactGroups', description='The alert groups that receive alert notifications for the application group.'),
    groupName?: string(name='GroupName', description='The name of the application group.', example='ECS_test'),
  }(name='Group', description='The deleted application group.'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CA35B3AE-4FFD-4A33-AE67-67EF68711EFA'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteMonitorGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMonitorGroupResponseBody(name='body'),
}

/**
 * @summary Deletes an application group.
 *
 * @param request DeleteMonitorGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMonitorGroupResponse
 */
async function deleteMonitorGroupWithOptions(request: DeleteMonitorGroupRequest, runtime: Util.RuntimeOptions): DeleteMonitorGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMonitorGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes an application group.
 *
 * @param request DeleteMonitorGroupRequest
 * @return DeleteMonitorGroupResponse
 */
async function deleteMonitorGroup(request: DeleteMonitorGroupRequest): DeleteMonitorGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMonitorGroupWithOptions(request, runtime);
}

model DeleteMonitorGroupDynamicRuleRequest {
  category?: string(name='Category', description='The service to which the rule applies. Valid values: ecs, rds, and slb.

This parameter is required.', example='ecs'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model DeleteMonitorGroupDynamicRuleResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='56B4516A-EB44-4C66-8854-0393B35F636B'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DeleteMonitorGroupDynamicRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMonitorGroupDynamicRuleResponseBody(name='body'),
}

/**
 * @summary Deletes a rule that is used to dynamically add instances of a service that meet the rule to an application group.
 *
 * @param request DeleteMonitorGroupDynamicRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMonitorGroupDynamicRuleResponse
 */
async function deleteMonitorGroupDynamicRuleWithOptions(request: DeleteMonitorGroupDynamicRuleRequest, runtime: Util.RuntimeOptions): DeleteMonitorGroupDynamicRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMonitorGroupDynamicRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a rule that is used to dynamically add instances of a service that meet the rule to an application group.
 *
 * @param request DeleteMonitorGroupDynamicRuleRequest
 * @return DeleteMonitorGroupDynamicRuleResponse
 */
async function deleteMonitorGroupDynamicRule(request: DeleteMonitorGroupDynamicRuleRequest): DeleteMonitorGroupDynamicRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMonitorGroupDynamicRuleWithOptions(request, runtime);
}

model DeleteMonitorGroupInstancesRequest {
  category?: string(name='Category', description='The abbreviation of the cloud service name.

>  For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.

This parameter is required.', example='ecs'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  instanceIdList?: string(name='InstanceIdList', description='The instances to be removed from the application group. Separate multiple instances with commas (,). You can remove a maximum of 20 instances from an application group at a time.

This parameter is required.', example='i-a2d5q7pm3f912****,i-a2d5q7pm3f222****'),
  regionId?: string(name='RegionId'),
}

model DeleteMonitorGroupInstancesResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='5351B0F2-26A9-4BC9-87FF-1B74034D12C3'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMonitorGroupInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMonitorGroupInstancesResponseBody(name='body'),
}

/**
 * @summary Removes instances from an application group.
 *
 * @param request DeleteMonitorGroupInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMonitorGroupInstancesResponse
 */
async function deleteMonitorGroupInstancesWithOptions(request: DeleteMonitorGroupInstancesRequest, runtime: Util.RuntimeOptions): DeleteMonitorGroupInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceIdList)) {
    query['InstanceIdList'] = request.instanceIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMonitorGroupInstances',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Removes instances from an application group.
 *
 * @param request DeleteMonitorGroupInstancesRequest
 * @return DeleteMonitorGroupInstancesResponse
 */
async function deleteMonitorGroupInstances(request: DeleteMonitorGroupInstancesRequest): DeleteMonitorGroupInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMonitorGroupInstancesWithOptions(request, runtime);
}

model DeleteMonitorGroupNotifyPolicyRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.', example='6780****'),
  policyType?: string(name='PolicyType', description='The policy type.

Valid value: PauseNotify.

This parameter is required.', example='PauseNotify'),
  regionId?: string(name='RegionId'),
}

model DeleteMonitorGroupNotifyPolicyResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='B7AF834D-D38B-4A46-920B-FE974EB7E135'),
  result?: int32(name='Result', description='The number of affected rows.', example='1'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMonitorGroupNotifyPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMonitorGroupNotifyPolicyResponseBody(name='body'),
}

/**
 * @summary Deletes a policy that is used to pause alert notifications for an application group.
 *
 * @param request DeleteMonitorGroupNotifyPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMonitorGroupNotifyPolicyResponse
 */
async function deleteMonitorGroupNotifyPolicyWithOptions(request: DeleteMonitorGroupNotifyPolicyRequest, runtime: Util.RuntimeOptions): DeleteMonitorGroupNotifyPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.policyType)) {
    query['PolicyType'] = request.policyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMonitorGroupNotifyPolicy',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a policy that is used to pause alert notifications for an application group.
 *
 * @param request DeleteMonitorGroupNotifyPolicyRequest
 * @return DeleteMonitorGroupNotifyPolicyResponse
 */
async function deleteMonitorGroupNotifyPolicy(request: DeleteMonitorGroupNotifyPolicyRequest): DeleteMonitorGroupNotifyPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMonitorGroupNotifyPolicyWithOptions(request, runtime);
}

model DeleteMonitoringAgentProcessRequest {
  instanceId?: string(name='InstanceId', description='The instance ID.

This parameter is required.', example='i-KpVny6l****'),
  processId?: string(name='ProcessId', description='The process ID.

> You must configure either `ProcessId` or `ProcessName`.', example='123****'),
  processName?: string(name='ProcessName', description='The process name.

> You must configure either `ProcessId` or `ProcessName`.', example='http'),
  regionId?: string(name='RegionId'),
}

model DeleteMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='971CC023-5A96-452A-BB7C-2483F948BCFD'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DeleteMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @summary Disables monitoring on a process.
 *
 * @param request DeleteMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMonitoringAgentProcessResponse
 */
async function deleteMonitoringAgentProcessWithOptions(request: DeleteMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): DeleteMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.processId)) {
    query['ProcessId'] = request.processId;
  }
  if (!Util.isUnset(request.processName)) {
    query['ProcessName'] = request.processName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables monitoring on a process.
 *
 * @param request DeleteMonitoringAgentProcessRequest
 * @return DeleteMonitoringAgentProcessResponse
 */
async function deleteMonitoringAgentProcess(request: DeleteMonitoringAgentProcessRequest): DeleteMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMonitoringAgentProcessWithOptions(request, runtime);
}

model DeleteSiteMonitorsRequest {
  isDeleteAlarms?: boolean(name='IsDeleteAlarms', description='Specifies whether to delete the alert rules configured for the site monitoring tasks. Valid values:

*   true (default value)
*   false', example='true'),
  regionId?: string(name='RegionId'),
  taskIds?: string(name='TaskIds', description='The IDs of the site monitoring tasks that you want to delete. Separate multiple task IDs with commas (,).

This parameter is required.', example='01adacc2-ece5-41b6-afa2-3143ab5d****,43bd1ead-514f-4524-813e-228ce091****'),
}

model DeleteSiteMonitorsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  data?: {
    count?: int32(name='count', description='The number of the site monitoring tasks that were deleted.', example='0'),
  }(name='Data', description='The information about the site monitoring tasks that were deleted.'),
  message?: string(name='Message', description='The returned message. If the call was successful, the value success is returned. If the call failed, an error message such as `TaskId not found` is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='123BCC5D-8B63-48EA-B747-9A8995BE7AA6'),
  success?: string(name='Success', description='Indicates whether the call was successful. The value true indicates success. The value false indicates failure.', example='true'),
}

model DeleteSiteMonitorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSiteMonitorsResponseBody(name='body'),
}

/**
 * @summary Deletes one or more site monitoring tasks.
 *
 * @param request DeleteSiteMonitorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSiteMonitorsResponse
 */
async function deleteSiteMonitorsWithOptions(request: DeleteSiteMonitorsRequest, runtime: Util.RuntimeOptions): DeleteSiteMonitorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.isDeleteAlarms)) {
    query['IsDeleteAlarms'] = request.isDeleteAlarms;
  }
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSiteMonitors',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes one or more site monitoring tasks.
 *
 * @param request DeleteSiteMonitorsRequest
 * @return DeleteSiteMonitorsResponse
 */
async function deleteSiteMonitors(request: DeleteSiteMonitorsRequest): DeleteSiteMonitorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSiteMonitorsWithOptions(request, runtime);
}

model DescribeActiveMetricRuleListRequest {
  product?: string(name='Product', description='The abbreviation of the cloud service that supports initiative alert rules.

For more information about how to obtain the name of a cloud service, see [DescribeProductsOfActiveMetricRule](https://help.aliyun.com/document_detail/114930.html).

This parameter is required.', example='ecs'),
}

model DescribeActiveMetricRuleListResponseBody = {
  alertList?: {
    alert?: [ 
    {
      alertState?: string(name='AlertState', description='The status of the alert rule. Valid values:

*   OK: The alert rule has no active alerts.
*   ALARM: The alert rule has active alerts.
*   INSUFFICIENT_DATA: No data is found.', example='OK'),
      contactGroups?: string(name='ContactGroups', description='The alert contact group.', example='ECS_Group'),
      dimensions?: string(name='Dimensions', description='The monitoring data of the specified resource.', example='""'),
      effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective.', example='00:00-23:59'),
      enableState?: boolean(name='EnableState', description='Indicates whether the alert rule is enabled. Valid values:

*   true: The alert rule is enabled.
*   false: The alert rule is disabled.', example='true'),
      escalations?: {
        critical?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanThreshold'),
          statistics?: string(name='Statistics', description='The statistical methods for Critical-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.', example='99'),
          times?: string(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.', example='3'),
        }(name='Critical', description='The trigger condition for Critical-level alerts.'),
        info?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Info-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanThreshold'),
          statistics?: string(name='Statistics', description='The statistical methods for Info-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Info-level alerts.', example='95'),
          times?: string(name='Times', description='The consecutive number of times

for which the metric value meets the alert condition before an Info-level alert is triggered.', example='3'),
        }(name='Info', description='The conditions for triggering Info-level alerts.'),
        warn?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanThreshold'),
          statistics?: string(name='Statistics', description='The statistical methods for Warn-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.', example='80'),
          times?: string(name='Times', description='The consecutive number of times

for which the metric value meets the alert condition before a Warn-level alert is triggered.', example='3'),
        }(name='Warn', description='The conditions for triggering Warn-level alerts.'),
      }(name='Escalations', description='The conditions for triggering different levels of alerts.'),
      mailSubject?: string(name='MailSubject', description='The subject of the alert notification email.', example='ECS_Bucket'),
      metricName?: string(name='MetricName', description='The name of the metric.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the Alibaba Cloud service.', example='acs_ecs_dashboard'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective.', example='00:00-06:00'),
      period?: string(name='Period', description='The aggregation period of monitoring data.

Unit: seconds.', example='60'),
      resources?: string(name='Resources', description='The resources that are associated with the alert rule.', example='[{"resource":"_ALL"}]'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='ruleIdxxxx'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='myAlert'),
      silenceTime?: string(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met.

Unit: seconds.', example='86400'),
      webhook?: string(name='Webhook', description='The callback URL.', example='http://www.aliyun.com'),
    }
  ](name='Alert')
  }(name='AlertList', description='The details of the alert rules. The result is in the same structure as that returned by the DescribeMetricRuleList operation.'),
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  datapoints?: {
    alarm?: [ 
    {
      comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used in the alert rule. Valid values:

*   `>`
*   `<`
*   `>=`
*   `<=`
*   `=`
*   `=`', example='>'),
      contactGroups?: string(name='ContactGroups', description='The alert contact group.', example='ECS_Group'),
      enable?: string(name='Enable', description='Indicates whether the alert rule is enabled. Valid values:

*   true: The alert rule is enabled.
*   false: The alert rule is disabled.', example='true'),
      endTime?: string(name='EndTime', description='The end of the time period during which the alert rule is effective.

Unit: hours. For example, the value 23 indicates `23:59:59`.', example='24'),
      evaluationCount?: string(name='EvaluationCount', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='3'),
      metricName?: string(name='MetricName', description='The metric name.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_ecs_dashboard'),
      period?: string(name='Period', description='The aggregation period of monitoring data.

Unit: seconds.', example='60'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='a151cd6023eacee2f0978e03863cc1697c89508****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='SystemDefault_acs_rds_dashboard_CpuUsage'),
      silenceTime?: string(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met.

Unit: seconds.', example='86400'),
      startTime?: string(name='StartTime', description='The beginning of the time period during which the alert rule is effective.

Unit: hours. For example, the value 00 indicates `00:00:00`.', example='00'),
      state?: string(name='State', description='Indicates whether the alert rule is enabled.', example='Enable'),
      statistics?: string(name='Statistics', description='The statistical method.', example='Average'),
      threshold?: string(name='Threshold', description='The alert threshold.', example='90'),
      webhook?: string(name='Webhook', description='The callback URL.', example='http://www.aliyun.com'),
    }
  ](name='Alarm')
  }(name='Datapoints', description='The details of the alert rules.'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F82E6667-7811-4BA0-842F-5B2DC42BBAAD'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeActiveMetricRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeActiveMetricRuleListResponseBody(name='body'),
}

/**
 * @summary Queries the details of initiative alert rules.
 *
 * @param request DescribeActiveMetricRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeActiveMetricRuleListResponse
 */
async function describeActiveMetricRuleListWithOptions(request: DescribeActiveMetricRuleListRequest, runtime: Util.RuntimeOptions): DescribeActiveMetricRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeActiveMetricRuleList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of initiative alert rules.
 *
 * @param request DescribeActiveMetricRuleListRequest
 * @return DescribeActiveMetricRuleListResponse
 */
async function describeActiveMetricRuleList(request: DescribeActiveMetricRuleListRequest): DescribeActiveMetricRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeActiveMetricRuleListWithOptions(request, runtime);
}

model DescribeAlertHistoryListRequest {
  ascending?: boolean(name='Ascending', description='The order of alerts. Valid values:

*   true (default value): reverse chronological order
*   false: chronological order', example='true'),
  endTime?: string(name='EndTime', description='The end timestamp of the historical alerts that you want to query.

Unit: milliseconds.', example='1640608200000'),
  groupId?: string(name='GroupId', description='The ID of the application group.

For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='7671****'),
  metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.

For information about how to query the name of a metric, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For information about how to query the namespace of a cloud service, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  page?: int32(name='Page', description='The number of the page to return.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

For information about how to query the name of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='ECS_Rule'),
  startTime?: string(name='StartTime', description='The start timestamp of the historical alerts that you want to query.

Unit: milliseconds.', example='1640237400000'),
  state?: string(name='State', description='The status of the alert. Valid values:

*   ALARM (default value): Alerts are triggered.
*   OK: No alerts are triggered.', example='ALARM'),
  status?: string(name='Status', description='Specifies whether alerts are muted. Valid values:

*   2 (default value): Alerts are muted and are not triggered within the mute period, even if the condition specified in the alert rule is met.
*   0: Alerts are triggered or cleared.
*   1: The alert rule is ineffective.', example='2'),
}

model DescribeAlertHistoryListResponseBody = {
  alarmHistoryList?: {
    alarmHistory?: [ 
    {
      alertTime?: long(name='AlertTime', description='The timestamp when the alert was triggered. Unit: milliseconds.', example='1640586600000'),
      contactALIIMs?: {
        contactALIIM?: [ string ](name='ContactALIIM')
      }(name='ContactALIIMs', description='The TradeManager IDs of the alert contacts.

> This parameter is valid only on the China site (aliyun.com).'),
      contactGroups?: {
        contactGroup?: [ string ](name='ContactGroup')
      }(name='ContactGroups', description='The alert contact groups.'),
      contactMails?: {
        contactMail?: [ string ](name='ContactMail')
      }(name='ContactMails', description='The email addresses of the alert contacts.'),
      contactSmses?: {
        contactSms?: [ string ](name='ContactSms')
      }(name='ContactSmses', description='The mobile numbers of the alert contacts.

> This parameter is valid only on the China site (aliyun.com).'),
      contacts?: {
        contact?: [ string ](name='Contact')
      }(name='Contacts', description='The alert contacts that receive alert notifications.'),
      dimensions?: string(name='Dimensions', description='The resources that are monitored.', example='{\\\\"instanceId\\\\":\\\\"i-bp1cqhiw1za2****\\\\"}'),
      evaluationCount?: int32(name='EvaluationCount', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='3'),
      expression?: string(name='Expression', description='The expression that is used to trigger alerts.', example='$Average>=10'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='7671****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='i-bp1cqhiw1za2****'),
      lastTime?: long(name='LastTime', description='The duration of the alert. Unit: milliseconds.', example='360133'),
      level?: string(name='Level', description='The severity level and notification methods of the alert. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
      metricName?: string(name='MetricName', description='The metric name.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_ecs_dashboard'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='applyTemplate61dc81b5-d357-4cf6-a9b7-9f83c1d5****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='ECS_Rule'),
      state?: string(name='State', description='The alert status. Valid values:

*   ALARM: Alerts are triggered.
*   OK: No alerts are triggered.', example='ALARM'),
      status?: int32(name='Status', description='Indicates whether alerts are muted. Valid values:

*   2 (default): Alerts are muted and are not triggered within the mute period, even if the condition specified in the alert rule is met.
*   0: Alerts are triggered or cleared.
*   1: The alert rule is ineffective.', example='2'),
      value?: string(name='Value', description='The threshold of the metric value to trigger or clear an alert.', example='10.58'),
      webhooks?: string(name='Webhooks', description='The callback URL.', example='https://www.aliyun.com'),
    }
  ](name='AlarmHistory')
  }(name='AlarmHistoryList', description='The details of historical alerts.'),
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C3C69FBE-2262-541F-A409-C52F380BAE63'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: string(name='Total', description='The total number of entries returned.', example='2'),
}

model DescribeAlertHistoryListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAlertHistoryListResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI DescribeAlertHistoryList is deprecated, please use Cms::2019-01-01::DescribeAlertLogList instead.
 *
 * @summary Queries historical alerts.
 *
 * @description This API operation is no longer maintained. We recommend that you call the [DescribeAlertLogList](https://help.aliyun.com/document_detail/201087.html) operation.
 *
 * @param request DescribeAlertHistoryListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAlertHistoryListResponse
 */
// Deprecated
async function describeAlertHistoryListWithOptions(request: DescribeAlertHistoryListRequest, runtime: Util.RuntimeOptions): DescribeAlertHistoryListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ascending)) {
    query['Ascending'] = request.ascending;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlertHistoryList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI DescribeAlertHistoryList is deprecated, please use Cms::2019-01-01::DescribeAlertLogList instead.
 *
 * @summary Queries historical alerts.
 *
 * @description This API operation is no longer maintained. We recommend that you call the [DescribeAlertLogList](https://help.aliyun.com/document_detail/201087.html) operation.
 *
 * @param request DescribeAlertHistoryListRequest
 * @return DescribeAlertHistoryListResponse
 */
// Deprecated
async function describeAlertHistoryList(request: DescribeAlertHistoryListRequest): DescribeAlertHistoryListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlertHistoryListWithOptions(request, runtime);
}

model DescribeAlertLogCountRequest {
  contactGroup?: string(name='ContactGroup', description='The alert group.', example='ECS_Group'),
  endTime?: long(name='EndTime', description='The end timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the `AlertLogCount` parameter is empty.

>  The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.', example='1610074409694'),
  eventType?: string(name='EventType', description='The type of the alert event. Valid values:

*   TRIGGERED: The alert is triggered.
*   RESOLVED: The alert is resolved.', example='TRIGGERED'),
  groupBy?: string(name='GroupBy', description='The dimension based on which data is aggregated. This parameter is similar to the Group By clause of SQL statements. Valid values:

*   `product`: aggregates data by cloud service.
*   `level`: aggregates data by alert level.
*   `groupId`: aggregates data by application group.
*   `contactGroup`: aggregates data by alert group.
*   `product,metricName`: aggregates data both by cloud service and by metric.

This parameter is required.', example='product'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
  lastMin?: string(name='LastMin', description='The statistical period of alert logs. Unit: minutes.', example='360'),
  level?: string(name='Level', description='The level and notification method of the alert. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
  metricName?: string(name='MetricName', description='The name of the metric.

>  For more information about the metrics of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

>  For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  pageNumber?: int32(name='PageNumber', description='The dimension based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:

*   `product`: aggregates data by cloud service.
*   `level`: aggregates data by alert level.
*   `groupId`: aggregates data by application group.
*   `contactGroup`: aggregates data by alert contact group.
*   `product,metricName`: aggregates data both by cloud service and by metric.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: 10.', example='10'),
  product?: string(name='Product', description='The abbreviation of the service name.', example='ECS'),
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For more information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='bfae2ca5b4e07d2c7278772e***********'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.', example='test123'),
  searchKey?: string(name='SearchKey', description='The keyword based on which the alert logs to be counted are searched.', example='test'),
  sendStatus?: string(name='SendStatus', description='The status of the alert. Valid values:

*   0: The alert is triggered or cleared.
*   1: The alert is generated not during the effective period.
*   2: The alert is muted and not triggered in a specified period.
*   3: The host is restarting.
*   4: Notifications are not sent for the alert.

When the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.', example='0'),
  sourceType?: string(name='SourceType', description='This parameter is deprecated.', example='None'),
  startTime?: long(name='StartTime', description='The start timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the `AlertLogCount` parameter is empty.

>  The interval between the start time (StartTime) and end time (EndTime) must be less than or equal to 15 days. The start time and end time must be specified or left empty at the same time. If you do not specify the start time and end time, the alert logs within the last 15 minutes are queried by default.', example='1609988009694'),
}

model DescribeAlertLogCountResponseBody = {
  alertLogCount?: [ 
    {
      count?: int32(name='Count', description='The number of alert logs.', example='1'),
      logs?: [ 
        {
          name?: string(name='Name', description='The name of the dimension field based on which alert logs are aggregated.', example='product'),
          value?: string(name='Value', description='The value of the dimension field based on which alert logs are aggregated.', example='ECS'),
        }
      ](name='Logs', description='The details about alert logs.'),
    }
  ](name='AlertLogCount', description='The statistics of alert logs.'),
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1C4A3709-BF52-42EE-87B5-7435F0929585'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeAlertLogCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAlertLogCountResponseBody(name='body'),
}

/**
 * @summary Queries the statistics of alert logs.
 *
 * @description Queries the statistics of alert logs.
 * This topic provides an example on how to query the statistics of alert logs for Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAlertLogCountResponse
 */
async function describeAlertLogCountWithOptions(request: DescribeAlertLogCountRequest, runtime: Util.RuntimeOptions): DescribeAlertLogCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroup)) {
    query['ContactGroup'] = request.contactGroup;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.lastMin)) {
    query['LastMin'] = request.lastMin;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.sendStatus)) {
    query['SendStatus'] = request.sendStatus;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlertLogCount',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics of alert logs.
 *
 * @description Queries the statistics of alert logs.
 * This topic provides an example on how to query the statistics of alert logs for Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogCountRequest
 * @return DescribeAlertLogCountResponse
 */
async function describeAlertLogCount(request: DescribeAlertLogCountRequest): DescribeAlertLogCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlertLogCountWithOptions(request, runtime);
}

model DescribeAlertLogHistogramRequest {
  contactGroup?: string(name='ContactGroup', description='The alert contact group.', example='ECS_Group'),
  endTime?: long(name='EndTime', description='The end timestamp of the alert logs to be queried.

Unit: milliseconds.

> 

*   You can query only the alert logs within the last year.

*   The interval between the start time (`StartTime`) and end time (`EndTime`) must be less than or equal to 15 days.', example='1609989009694'),
  eventType?: string(name='EventType', description='The type of the alert event. Valid values:

*   TRIGGERED: The alert is triggered.
*   RESOLVED: The alert is resolved.', example='RESOLVED'),
  groupBy?: string(name='GroupBy', description='The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:

*   `product`: aggregates data by cloud service.
*   `level`: aggregates data by alert level.
*   `groupId`: aggregates data by application group.
*   `contactGroup`: aggregates data by alert contact group.
*   `product,metricName`: aggregates data both by cloud service and by metric.', example='product'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
  lastMin?: string(name='LastMin', description='The statistical period of alert logs. Unit: minutes.', example='360'),
  level?: string(name='Level', description='The severity level and notification methods of the alert. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
  metricName?: string(name='MetricName', description='The metric name.

>  For more information about the metrics of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the Alibaba Cloud service.

>  For more information about the namespaces of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Default value: 10.', example='10'),
  product?: string(name='Product', description='The abbreviation of the Alibaba Cloud service name.', example='ECS'),
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For more information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='ae06917_75a8c43178ab66****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.', example='test123'),
  searchKey?: string(name='SearchKey', description='The keyword that is used to query alert logs.', example='alert'),
  sendStatus?: string(name='SendStatus', description='The alert status. Valid values:

*   0: The alert is triggered or cleared.
*   1: The alert is ineffective.
*   2: The alert is muted and not triggered in a specified period.
*   3: The host is restarting.
*   4: No alert notification is sent.

If the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.', example='0'),
  sourceType?: string(name='SourceType', description='This parameter is deprecated.', example='None'),
  startTime?: long(name='StartTime', description='The start timestamp of the alert logs to be queried.

Unit: milliseconds.

> 

*   You can query only the alert logs within the last year.

*   The interval between the start time (`StartTime`) and end time (`EndTime`) must be less than or equal to 15 days.', example='1609988009694'),
}

model DescribeAlertLogHistogramResponseBody = {
  alertLogHistogramList?: [ 
    {
      count?: int32(name='Count', description='The number of alert logs.', example='20'),
      from?: long(name='From', description='The start timestamp of the queried alert logs.

Unit: seconds.', example='1610074791'),
      to?: long(name='To', description='The end timestamp of the queried alert logs.

Unit: seconds.', example='1610074800'),
    }
  ](name='AlertLogHistogramList', description='The number of alert logs that were generated during each interval of a time period.'),
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='1C4A3709-BF52-42EE-87B5-7435F0929585'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeAlertLogHistogramResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAlertLogHistogramResponseBody(name='body'),
}

/**
 * @summary Queries the number of alert logs that are generated during each interval within a period of time.
 *
 * @description This topic provides an example on how to query the number of alert logs for Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogHistogramRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAlertLogHistogramResponse
 */
async function describeAlertLogHistogramWithOptions(request: DescribeAlertLogHistogramRequest, runtime: Util.RuntimeOptions): DescribeAlertLogHistogramResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroup)) {
    query['ContactGroup'] = request.contactGroup;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.lastMin)) {
    query['LastMin'] = request.lastMin;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.sendStatus)) {
    query['SendStatus'] = request.sendStatus;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlertLogHistogram',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of alert logs that are generated during each interval within a period of time.
 *
 * @description This topic provides an example on how to query the number of alert logs for Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogHistogramRequest
 * @return DescribeAlertLogHistogramResponse
 */
async function describeAlertLogHistogram(request: DescribeAlertLogHistogramRequest): DescribeAlertLogHistogramResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlertLogHistogramWithOptions(request, runtime);
}

model DescribeAlertLogListRequest {
  contactGroup?: string(name='ContactGroup', description='The alert contact group.', example='ECS_Group'),
  endTime?: long(name='EndTime', description='The end timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the `AlertLogList` parameter is empty.

>  The time period between the start time specified by `StartTime` and end time specified by `EndTime` must be less than or equal to 15 days. You must specify StartTime and EndTime at the same time, or leave StartTime and EndTime empty at the same time. If you do not specify this parameter, the alert logs within the last 15 minutes are queried by default.', example='1610074409694'),
  eventType?: string(name='EventType', description='The type of the alert event. Valid values:

*   TRIGGERED: The alert is triggered.
*   RESOLVED: The alert is resolved.', example='TRIGGERED'),
  groupBy?: string(name='GroupBy', description='The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL. Valid values:

*   `product`: aggregates data by cloud service.
*   `level`: aggregates data by alert level.
*   `groupId`: aggregates data by application group.
*   `contactGroup`: aggregates data by alert contact group.
*   `product,metricName`: aggregates data both by cloud service and by metric.', example='product'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
  lastMin?: string(name='LastMin', description='The statistical period of alert logs. Unit: minutes.', example='360'),
  level?: string(name='Level', description='The severity level and notification methods of the alert. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
  metricName?: string(name='MetricName', description='The metric name.

> For more information about the metrics of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='IntranetInRate'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

>  For information about how to query the namespace of a cloud service, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Default value: 10.', example='10'),
  product?: string(name='Product', description='The abbreviation of the service name.

For information about how to obtain the abbreviation of a cloud service name, see [DescribeProductsOfActiveMetricRule](https://help.aliyun.com/document_detail/114930.html).', example='ECS'),
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='bc369e8_30f87e517ed2fc****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.', example='test123'),
  searchKey?: string(name='SearchKey', description='The search keyword that is used to query alert logs.', example='alert'),
  sendStatus?: string(name='SendStatus', description='The status of the alert. Valid values:

*   0: The alert is triggered or cleared.
*   1: The alert is ineffective.
*   2: The alert is muted.
*   3: The host is restarting.
*   4: No alert notification is sent.

If the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.', example='0'),
  sourceType?: string(name='SourceType', description='The type of the alert rule. Valid value: METRIC. This value indicates an alert rule for time series metrics.', example='METRIC'),
  startTime?: long(name='StartTime', description='The start timestamp of the alert logs to be queried.

Unit: milliseconds.

You can query only the alert logs within the last year. If the query time is longer than one year, the return value of the `AlertLogList` parameter is empty.

>  The time period between the start time specified by `StartTime` and the end time specified by `EndTime` must be less than or equal to 15 days. You must specify StartTime and EndTime at the same time, or leave StartTime and EndTime empty at the same time. If you do not specify this parameter, the alert logs within the last 15 minutes are queried by default.', example='1609988009694'),
}

model DescribeAlertLogListResponseBody = {
  alertLogList?: [ 
    {
      alertTime?: string(name='AlertTime', description='The timestamp that was generated when the alert was triggered.

Unit: milliseconds.', example='1610043776621'),
      blackListDetail?: string(name='BlackListDetail', description='The details of the blacklist policy.', example='BlackListDetail'),
      blackListName?: string(name='BlackListName', description='The name of the blacklist policy.', example='{"id":123,"metricProject":"acs_ecs_dashboard","userId":1736511134389110,"uuid":"8410dbbd-7d30-41c5-94cb-***","name":"alert-***","productCategory":"ecs","instances":[{"instanceId":"host-***"}],"metrics":null,"scopeType":"USER","scopeValue":"","startTime":"0001-01-01T00:00:00Z","endTime":"9999-12-31T23:59:59.999999999+08:00","effectiveTime":null,"isEnable":true,"status":1,"gmtCreate":"2021-11-02T16:35:59+08:00","gmtModified":"2021-11-02T16:35:59+08:00","loadTime":"2021-11-02T16:36:15.213072177+08:00"}'),
      blackListUUID?: string(name='BlackListUUID', description='The ID of the blacklist policy.', example='8410dbbd-7d30-41c5-94cb-*****'),
      contactALIIWWList?: [ string ](name='ContactALIIWWList'),
      contactDingList?: [ string ](name='ContactDingList'),
      contactGroups?: [ string ](name='ContactGroups'),
      contactMailList?: [ string ](name='ContactMailList'),
      contactOnCallList?: [ string ](name='ContactOnCallList'),
      contactSMSList?: [ string ](name='ContactSMSList'),
      dimensions?: [ 
        {
          key?: string(name='Key', description='The key of the dimension.', example='instanceId'),
          value?: string(name='Value', description='The value of the dimension.', example='i-m5e1qg6uo38rztr4****'),
        }
      ](name='Dimensions', description='The dimensions of the resource that triggered alerts.'),
      dingdingWebhookList?: [ string ](name='DingdingWebhookList'),
      escalation?: {
        expression?: string(name='Expression', description='The description of the alert rule.

>  The content of the alert rule. This parameter indicates the conditions that trigger an alert.', example='$Average<90'),
        level?: string(name='Level', description='The alert level and the methods that are used to send alert notifications. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='1'),
      }(name='Escalation', description='The alert rule based on which the alert is triggered.'),
      eventName?: string(name='EventName', description='The event name.', example='IOHang'),
      extendedInfo?: [ 
        {
          name?: string(name='Name', description='The name of the extended field.', example='userId'),
          value?: string(name='Value', description='The value of the extended field.', example='120886317861****'),
        }
      ](name='ExtendedInfo', description='The extended fields.'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
      groupName?: string(name='GroupName', description='The name of the application group.', example='ECS_Instances'),
      instanceId?: string(name='InstanceId', description='The resource ID.', example='i-m5e1qg6uo38rztr4****'),
      instanceName?: string(name='InstanceName', description='The resource name.', example='portalHost'),
      level?: string(name='Level', description='The alert level and the methods that are used to send alert notifications. Valid values:

*   P4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='P4'),
      levelChange?: string(name='LevelChange', description='Indicates whether the alert level was changed. Valid values:

*   `P4->OK`: The alert level was changed from P4 to OK.
*   `P4->P4`: The alert level was still P4.', example='P4->OK'),
      logId?: string(name='LogId', description='The log ID.', example='7818361[1523]@1671593992[1]'),
      message?: string(name='Message', description='The alert information in a JSON string.', example='{"alertName":"e47aa0ac-4076-44db-a47d-d1083968****_Availability"}'),
      metricName?: string(name='MetricName', description='The metric name.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_ecs_dashboard'),
      product?: string(name='Product', description='The identifier of the cloud service. Valid values:

*   If the cloud service is provided by Alibaba Cloud, the abbreviation of the service name is returned. Example: ECS.
*   If the cloud service is not provided by Alibaba Cloud, a value in the `acs_Service keyword` format is returned. Example: acs_networkmonitor.', example='ECS'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='d582b9e9-b1c1-4f17-9279-0fe7333a****_ResponseTime'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.'),
      sendDetail?: {
        channelResultList?: [ 
          {
            channel?: string(name='Channel', description='The method that is used to send alert notifications. Valid values:

*   MAIL: email
*   SMS: text message
*   WEBHOOK: alert callback
*   SLS: Simple Log Service
*   ONCALL: phone call
*   FC: Function Compute
*   MNS: Message Service queue', example='MAIL'),
            resultList?: [ 
              {
                code?: string(name='Code', description='The HTTP status code.

*   If the value of the `Channel` parameter is `WEBHOOK`, the status code is 200 or 500.
*   If the value of the `Channel` parameter is `MAIL`, `SMS`, `SLS`, `ONCALL`, `FC`, or `MNS`, this parameter is empty or not returned.', example='200'),
                detail?: string(name='Detail', description='The details of the returned results.', example='{ }'),
                requestId?: string(name='RequestId', description='The request ID returned when CloudMonitor calls another cloud service.', example='0BDAF8A8-04DC-5F0C-90E4-724D42C4****'),
                success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
                notifyTargetList?: [ string ](name='notifyTargetList'),
              }
            ](name='ResultList', description='The sending results of alert notifications.'),
          }
        ](name='ChannelResultList', description='The list of sending results that are categorized by notification method.'),
        resultCode?: string(name='ResultCode', description='Indicates whether the alert notifications are sent.

*   If the alert notifications are sent, the value "success" is returned.
*   If the configuration is invalid, no alert notification is sent and an error code is returned.', example='success'),
      }(name='SendDetail', description='The details about the sending results of alert notifications.'),
      sendResultList?: [ 
        {
          key?: string(name='Key', description='The category of the alert notification method. Valid values:

*   MAIL: email
*   ALIIM: TradeManager
*   SMS: text message
*   CALL: phone call
*   DING: DingTalk chatbot
*   Merged: alert merging', example='Mail'),
          value?: [ string ](name='Value', description='The notification object corresponding to the alert notification method.'),
        }
      ](name='SendResultList', description='The sending results of alert notifications.'),
      sendStatus?: string(name='SendStatus', description='The status of the alert. Valid values:

*   0: The alert is triggered or cleared.
*   1: The alert is ineffective.
*   2: The alert is muted.
*   3: The host is restarting.
*   4: No alert notification is sent.

If the value of the SendStatus parameter is 0, the value P4 of the Level parameter indicates a triggered alert and the value OK indicates a cleared alert.', example='0'),
      webhookList?: [ 
        {
          code?: string(name='code', description='The status code of the alert callback.', example='200'),
          message?: string(name='message', description='The message returned for the alert callback.', example='success'),
          url?: string(name='url', description='The callback URL.', example='https://www.aliyun.com/webhook.html'),
        }
      ](name='WebhookList', description='The callback URLs.'),
    }
  ](name='AlertLogList', description='The queried alert logs.'),
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1C4A3709-BF52-42EE-87B5-7435F0929585'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeAlertLogListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAlertLogListResponseBody(name='body'),
}

/**
 * @summary Queries alert logs.
 *
 * @description You can call the operation to query only the alert logs within the last year.
 * This topic provides an example to show how to query the alert logs of Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAlertLogListResponse
 */
async function describeAlertLogListWithOptions(request: DescribeAlertLogListRequest, runtime: Util.RuntimeOptions): DescribeAlertLogListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroup)) {
    query['ContactGroup'] = request.contactGroup;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupBy)) {
    query['GroupBy'] = request.groupBy;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.lastMin)) {
    query['LastMin'] = request.lastMin;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.searchKey)) {
    query['SearchKey'] = request.searchKey;
  }
  if (!Util.isUnset(request.sendStatus)) {
    query['SendStatus'] = request.sendStatus;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlertLogList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries alert logs.
 *
 * @description You can call the operation to query only the alert logs within the last year.
 * This topic provides an example to show how to query the alert logs of Elastic Compute Service (ECS) based on the `product` dimension.
 *
 * @param request DescribeAlertLogListRequest
 * @return DescribeAlertLogListResponse
 */
async function describeAlertLogList(request: DescribeAlertLogListRequest): DescribeAlertLogListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlertLogListWithOptions(request, runtime);
}

model DescribeAlertingMetricRuleResourcesRequest {
  alertBeforeTime?: string(name='AlertBeforeTime', description='Queries the alerts that were triggered before the specified time. Timestamps in milliseconds are supported.', example='1698827400000'),
  dimensions?: string(name='Dimensions', description='The dimensions that specify the resources whose monitoring data you want to query.', example='{\\\\"userId\\\\":\\\\"120886317861****\\\\",\\\\"region\\\\":\\\\"cn-huhehaote\\\\",\\\\"queue\\\\":\\\\"test-0128\\\\"}'),
  groupId?: string(name='GroupId', description='The ID of the application group. For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='7671****'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_mns_new'),
  page?: int32(name='Page', description='The page number.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule. For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****'),
}

model DescribeAlertingMetricRuleResourcesResponseBody = {
  code?: int32(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The request processing has failed due to some unknown error.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0724011B-D9E0-4B2F-8C51-F17A894CC42C'),
  resources?: {
    resource?: [ 
    {
      dimensions?: string(name='Dimensions', description='The dimensions based on which the resources are queried.', example='{\\\\"region\\\\":\\\\"cn-huhehaote\\\\",\\\\"queue\\\\":\\\\"test-0128\\\\",\\\\"userId\\\\":\\\\"120886317861****\\\\"}'),
      enable?: string(name='Enable', description='Indicates whether the alert rule is enabled. Valid values:

*   true: The alert rule is enabled.
*   false: The alert rule is disabled.', example='true'),
      escalation?: {
        resource?: [ 
        {
          comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          expression?: string(name='Expression', description='The description of the alert rule.

>  This parameter indicates the content of the alert rule. If the metric value meets the alert condition, an alert is triggered.', example='$Average>=10'),
          expressionList?: {
            expressionList?: [ 
            {
              comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
              metricName?: string(name='MetricName', description='The metric name.', example='cpu_total'),
              period?: string(name='Period', description='The statistical period of the metric. Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected.', example='60'),
              statistics?: string(name='Statistics', description='The statistical method of the alert level. Valid values:

*   Maximum
*   Minimum
*   Average', example='Average'),
              threshold?: string(name='Threshold', description='The alert threshold.', example='90'),
            }
          ](name='ExpressionList')
          }(name='ExpressionList', description='The description of the multi-metric alert rule.'),
          expressionListJoin?: string(name='ExpressionListJoin', description='The relationship between multiple metrics. Valid values:

*   &&: If all metrics meet the alert conditions, CloudMonitor sends alert notifications.
*   ||: If one of the metrics meets the alert conditions, CloudMonitor sends alert notifications.', example='&&'),
          expressionRaw?: string(name='ExpressionRaw', description='The trigger conditions that are created by using expressions. You can use expressions to create trigger conditions in the following scenarios:

*   Set an alert blacklist for specific resources. For example, if you specify `$instanceId != \\\\"i-io8kfvcpp7x5****\\\\" ``&&`` $Average > 50`, no alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 50.
*   Set a special alert threshold for a specified instance in the rule. For example, if you specify `$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)`, an alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 80 or the `average metric value` of other instances exceeds 50.
*   Limit the number of instances whose metric values exceed the threshold. For example, if you specify `count($Average > 20) > 3`, an alert is triggered only when the `average metric value` of more than three instances exceeds 20.', example='$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)'),
          level?: int32(name='Level', description='The severity level and notification methods of the alert. Valid values:

*   4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='3'),
          preCondition?: string(name='PreCondition', description='The operator that is used to compare the metric value with the threshold. Valid values:

*   `>=`
*   `=`
*   `<=`
*   `>`
*   `<`
*   `!=`', example='>='),
          tag?: string(name='Tag', description='This parameter is deprecated.', example='mns'),
          threshold?: string(name='Threshold', description='The alert threshold.', example='10'),
          times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='1'),
        }
      ](name='Resource')
      }(name='Escalation', description='The alert rule based on which the alert is triggered.'),
      groupId?: string(name='GroupId', description='The ID of the application group.

>  If the alert rule is associated with an application group, the ID of the application group is returned in this parameter.', example='7671****'),
      lastAlertTime?: string(name='LastAlertTime', description='The time when the last alert was triggered for the resource based on the alert rule. The value is a timestamp.

Unit: milliseconds.', example='1622427900000'),
      lastModifyTime?: string(name='LastModifyTime', description='The time when the alert rule was last modified. The value is a timestamp.

Unit: milliseconds.', example='1622827900000'),
      level?: int32(name='Level', description='The severity level and notification methods of the alert. Valid values:

*   4: Alert notifications are sent by using emails and DingTalk chatbots.
*   OK: No alert is generated.', example='3'),
      metricName?: string(name='MetricName', description='The metric name.', example='ActiveMessages'),
      metricValues?: string(name='MetricValues', description='The metric value that triggered the alert based on the alert rule. The value is a JSON string.', example='{\\\\"timestamp\\\\":1623727500000,\\\\"Sum\\\\":926,\\\\"value\\\\":463,\\\\"Maximum\\\\":463,\\\\"Minimum\\\\":463,\\\\"Average\\\\":463,\\\\"SampleCount\\\\":2,\\\\"userId\\\\":\\\\"120886317861****\\\\",\\\\"region\\\\":\\\\"cn-huhehaote\\\\",\\\\"queue\\\\":\\\\"test-0128\\\\"}'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_mns_new'),
      productCategory?: string(name='ProductCategory', description='The type of the cloud service.', example='mns'),
      resource?: string(name='Resource', description='The resources that are monitored.', example='userId=120886317861****,region=cn-huhehaote,queue=test-0128'),
      retryTimes?: string(name='RetryTimes', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='3'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='putNewAlarm_user_7e78d765-0e3e-4671-ba6d-7ce39108****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='test123456789'),
      startTime?: string(name='StartTime', description='The time when the resource was associated with the alert rule. The value is a timestamp.

Unit: milliseconds.', example='1622427900000'),
      statistics?: string(name='Statistics', description='The method used to calculate the metric values that trigger alerts.', example='Average'),
      threshold?: string(name='Threshold', description='The alert threshold.', example='10'),
    }
  ](name='Resource')
  }(name='Resources', description='The resources that are associated with the alert rule.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='2'),
}

model DescribeAlertingMetricRuleResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAlertingMetricRuleResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the resources for which active alerts are triggered based on an alert rule.
 *
 * @param request DescribeAlertingMetricRuleResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAlertingMetricRuleResourcesResponse
 */
async function describeAlertingMetricRuleResourcesWithOptions(request: DescribeAlertingMetricRuleResourcesRequest, runtime: Util.RuntimeOptions): DescribeAlertingMetricRuleResourcesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAlertingMetricRuleResources',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resources for which active alerts are triggered based on an alert rule.
 *
 * @param request DescribeAlertingMetricRuleResourcesRequest
 * @return DescribeAlertingMetricRuleResourcesResponse
 */
async function describeAlertingMetricRuleResources(request: DescribeAlertingMetricRuleResourcesRequest): DescribeAlertingMetricRuleResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAlertingMetricRuleResourcesWithOptions(request, runtime);
}

model DescribeContactGroupListRequest {
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='10'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='1'),
  regionId?: string(name='RegionId'),
}

model DescribeContactGroupListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  contactGroupList?: {
    contactGroup?: [ 
    {
      contacts?: {
        contact?: [ string ](name='Contact')
      }(name='Contacts', description='The alert contacts in the alert group.'),
      createTime?: long(name='CreateTime', description='The time when the alert group was created. This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1507070598000'),
      describe?: string(name='Describe', description='The description of the alert group.'),
      enableSubscribed?: boolean(name='EnableSubscribed', description='Indicates whether the alert group subscribes to weekly reports. Valid values:

*   true: The alert group subscribes to weekly reports.
*   false: The alert group does not subscribe to weekly reports.', example='true'),
      enabledWeeklyReport?: boolean(name='EnabledWeeklyReport', description='Indicates whether the alert group can subscribe to weekly reports. Valid values:

*   true: The alert group can subscribe to weekly reports.
*   false: The alert group cannot subscribe to weekly reports.

>  The weekly report subscription feature is only available for Alibaba Cloud accounts with more than five Elastic Compute Service (ECS) instances.', example='true'),
      name?: string(name='Name', description='The name of the alert group.', example='Contact1'),
      updateTime?: long(name='UpdateTime', description='The time when the alert group was modified. This value is a UNIX timestamp that represents the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1589447759000'),
    }
  ](name='ContactGroup')
  }(name='ContactGroupList', description='The information about alert groups that were queried.'),
  contactGroups?: {
    contactGroup?: [ string ](name='ContactGroup')
  }(name='ContactGroups', description='The names of alert groups.'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='916EE694-03C2-47B6-85EE-5054E3C168D3'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  total?: int32(name='Total', description='The total number of the returned entries.', example='22'),
}

model DescribeContactGroupListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeContactGroupListResponseBody(name='body'),
}

/**
 * @summary Queries alert groups.
 *
 * @param request DescribeContactGroupListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeContactGroupListResponse
 */
async function describeContactGroupListWithOptions(request: DescribeContactGroupListRequest, runtime: Util.RuntimeOptions): DescribeContactGroupListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeContactGroupList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries alert groups.
 *
 * @param request DescribeContactGroupListRequest
 * @return DescribeContactGroupListResponse
 */
async function describeContactGroupList(request: DescribeContactGroupListRequest): DescribeContactGroupListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeContactGroupListWithOptions(request, runtime);
}

model DescribeContactListRequest {
  chanelType?: string(name='ChanelType', description='The alert notification method. Valid values:

*   Mail: emails
*   DingWebHook: DingTalk chatbots', example='Mail'),
  chanelValue?: string(name='ChanelValue', description='The value specified for the alert notification method.

>  This parameter is required only if you set the `ChanelType` parameter to `Mail`.', example='Alice@example.com'),
  contactName?: string(name='ContactName', description='The name of the alert contact.', example='Alice'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Default value: 100.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeContactListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  contacts?: {
    contact?: [ 
    {
      channels?: {
        aliIM?: string(name='AliIM', description='The TradeManager ID of the alert contact.', example='Alice'),
        dingWebHook?: string(name='DingWebHook', description='The webhook URL of the DingTalk chatbot.', example='https://oapi.dingtalk.com/robot/send?access_token=9bf44f8189597d07dfdd7a123455ffc112****'),
        mail?: string(name='Mail', description='The email address of the alert contact.', example='Alice@example.com'),
        SMS?: string(name='SMS', description='The phone number of the alert contac.', example='1333333****'),
      }(name='Channels', description='The alert notification method.'),
      channelsState?: {
        aliIM?: string(name='AliIM', description='The status of the TradeManager ID.

Valid value: OK. The value OK indicates that the TradeManager ID is valid and can receive alert notifications.

>  This parameter applies only to the Alibaba Cloud China site (aliyun.com).', example='OK'),
        dingWebHook?: string(name='DingWebHook', description='The status of the DingTalk chatbot.

Valid value: OK. The value OK indicates that the DingTalk chatbot is normal and alert notifications can be received in a DingTalk group.', example='OK'),
        mail?: string(name='Mail', description='The status of the email address. Valid values:

*   PENDING: The phone number is not activated. Alert notifications can be sent to the phone number by using text messages only after the phone number is activated.
*   OK: The phone number is activated and can receive alert notifications.', example='PENDING'),
        SMS?: string(name='SMS', description='The status of the phone number. Valid values:

*   PENDING: The phone number is not activated. Alert notifications can be sent to the phone number by using text messages only after the phone number is activated.
*   OK: The phone number is activated and can receive alert notifications.

>  This parameter applies only to the Alibaba Cloud China site (aliyun.com).', example='OK'),
      }(name='ChannelsState', description='The status of the alert notification method. Valid values: PENDING and OK.

The email address must be activated after it is added as the value specified for the alert notification method. The value PENDING indicates that the email address is not activated. The value OK indicates that the email address is activated.'),
      contactGroups?: {
        contactGroup?: [ string ](name='ContactGroup')
      }(name='ContactGroups', description='None.'),
      createTime?: long(name='CreateTime', description='The timestamp when the alert contact was created.

Unit: milliseconds.', example='1552356159000'),
      desc?: string(name='Desc', description='The description.'),
      lang?: string(name='Lang', description='The language in which the alert information is displayed. Valid values:

*   zh-cn: simplified Chinese
*   en: English', example='zh-cn'),
      name?: string(name='Name', description='The name of the alert contact.', example='Alice'),
      updateTime?: long(name='UpdateTime', description='The timestamp when the alert contact was updated.

Unit: milliseconds.', example='1552356159000'),
    }
  ](name='Contact')
  }(name='Contacts', description='The alert contacts.'),
  message?: string(name='Message', description='The error message returned.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='06D5ECC2-B9BE-42A4-8FA3-1A610FB08B83'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='15'),
}

model DescribeContactListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeContactListResponseBody(name='body'),
}

/**
 * @summary Queries alert contacts.
 *
 * @param request DescribeContactListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeContactListResponse
 */
async function describeContactListWithOptions(request: DescribeContactListRequest, runtime: Util.RuntimeOptions): DescribeContactListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.chanelType)) {
    query['ChanelType'] = request.chanelType;
  }
  if (!Util.isUnset(request.chanelValue)) {
    query['ChanelValue'] = request.chanelValue;
  }
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeContactList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries alert contacts.
 *
 * @param request DescribeContactListRequest
 * @return DescribeContactListResponse
 */
async function describeContactList(request: DescribeContactListRequest): DescribeContactListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeContactListWithOptions(request, runtime);
}

model DescribeContactListByContactGroupRequest {
  contactGroupName?: string(name='ContactGroupName', description='The name of the alert contact group.

This parameter is required.', example='CloudMonitor'),
  regionId?: string(name='RegionId'),
}

model DescribeContactListByContactGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  contacts?: {
    contact?: [ 
    {
      channels?: {
        aliIM?: string(name='AliIM', description='The TradeManager ID of the alert contact.

>  This parameter can be returned only on the China site (aliyun.com).', example='Alice'),
        dingWebHook?: string(name='DingWebHook', description='The webhook URL of the DingTalk chatbot.', example='https://oapi.dingtalk.com/robot/send?access_token=9bf44f8189597d07dfdd7a123455ffc112****'),
        mail?: string(name='Mail', description='The email address of the alert contact.', example='alice@example.com'),
        SMS?: string(name='SMS', description='The mobile number of the alert contact.

>  This parameter can be returned only on the China site (aliyun.com).', example='1333333****'),
      }(name='Channels', description='The alert notification methods.'),
      createTime?: long(name='CreateTime', description='The time when the alert contact was created.

Unit: milliseconds.', example='1552314252000'),
      desc?: string(name='Desc', description='The description of the alert contact.', example='ECS'),
      name?: string(name='Name', description='The name of the alert contact.', example='Alice'),
      updateTime?: long(name='UpdateTime', description='The time when the alert contact was modified.

Unit: milliseconds.', example='1552314252000'),
    }
  ](name='Contact')
  }(name='Contacts', description='The alert contacts that receive alert notifications.'),
  message?: string(name='Message', description='The returned message.', example='The group is not exists.'),
  requestId?: string(name='RequestId', description='The request ID.', example='06D5ECC2-B9BE-42A4-8FA3-1A610FB08B83'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeContactListByContactGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeContactListByContactGroupResponseBody(name='body'),
}

/**
 * @summary Queries the alert contacts in an alert contact group.
 *
 * @param request DescribeContactListByContactGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeContactListByContactGroupResponse
 */
async function describeContactListByContactGroupWithOptions(request: DescribeContactListByContactGroupRequest, runtime: Util.RuntimeOptions): DescribeContactListByContactGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroupName)) {
    query['ContactGroupName'] = request.contactGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeContactListByContactGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the alert contacts in an alert contact group.
 *
 * @param request DescribeContactListByContactGroupRequest
 * @return DescribeContactListByContactGroupResponse
 */
async function describeContactListByContactGroup(request: DescribeContactListByContactGroupRequest): DescribeContactListByContactGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeContactListByContactGroupWithOptions(request, runtime);
}

model DescribeCustomEventAttributeRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552227965971'),
  eventId?: string(name='EventId', description='The ID of the custom event.', example='123****'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='123****'),
  name?: string(name='Name', description='The name of the custom event.', example='test123'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.', example='50'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are contained in the content of the custom event to query. You can use a logical operator between keywords.

*   If you need to query the custom event whose content contains a and b, set the value to a and b.
*   If you need to query the custom event whose content contains a or b, set the value to a or b.', example='cms'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552224365971'),
}

model DescribeCustomEventAttributeResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  customEvents?: {
    customEvent?: [ 
    {
      content?: string(name='Content', description='The content of the custom event.', example='requestId:4975A6F3-19AC-4C01-BAD2-034DA07FEBB5, info:{"autoPay":false,"autoUseCoupon":false,"bid":"26842","buyerId":118935342242****,"commodities":[{"aliyunProduceCode":"cms","chargeType":"PREPAY","commodityCode":"cms_call_num","components":[{"componentCode":"phone_count","instanceProperty":[{"code":"phone_count","value":"500"}],"moduleAttrStatus":1}],"duration":6,"free":false,"orderParams":{"aliyunProduceCode":"cms"},"orderType":"BUY","prePayPostCharge":false,"pricingCycle":"Month","quantity":1,"refundSpecCode":"","renewChange":false,"specCode":"cms_call_num","specUpdate":false,"syncToSubscription":false,"upgradeInquireFinancialValue":true}],"fromApp":"commonbuy","orderParams":{"priceCheck":"true"},"payerId":118935342242****,"requestId":"ade3ad32-f58b-45d7-add4-ac542be3d8ec","skipChannel":false,"userId":118935342242****}'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
      id?: string(name='Id', description='The ID of the custom event.', example='123'),
      name?: string(name='Name', description='The name of the custom event.', example='BABEL_CHECK'),
      time?: string(name='Time', description='The time when the custom event occurred.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552199984000'),
    }
  ](name='CustomEvent')
  }(name='CustomEvents', description='The details of the custom event.'),
  message?: string(name='Message', description='The returned message.', example='userId:173651113438**** and name:"BABEL_CHECK"'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='60912C8D-B340-4253-ADE7-61ACDFD25CFC'),
  success?: string(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeCustomEventAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomEventAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a custom event that occurred in a specified time period.
 *
 * @param request DescribeCustomEventAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomEventAttributeResponse
 */
async function describeCustomEventAttributeWithOptions(request: DescribeCustomEventAttributeRequest, runtime: Util.RuntimeOptions): DescribeCustomEventAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomEventAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a custom event that occurred in a specified time period.
 *
 * @param request DescribeCustomEventAttributeRequest
 * @return DescribeCustomEventAttributeResponse
 */
async function describeCustomEventAttribute(request: DescribeCustomEventAttributeRequest): DescribeCustomEventAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomEventAttributeWithOptions(request, runtime);
}

model DescribeCustomEventCountRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552220485596'),
  eventId?: string(name='EventId', description='The ID of the custom event.', example='123'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
  name?: string(name='Name', description='The name of the custom event.', example='BABEL_BUY'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are contained in the content of the custom event to query. You can use a logical operator between keywords.

*   If you need to query the custom event whose content contains a and b, set the value to a and b.
*   If you need to query the custom event whose content contains a or b, set the value to a or b.', example='cms'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552209685596'),
}

model DescribeCustomEventCountResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  customEventCounts?: {
    customEventCount?: [ 
    {
      name?: string(name='Name', description='The name of the custom event.', example='BABEL_BUY'),
      num?: int32(name='Num', description='The number of times that the custom event occurred in the specified time period.', example='20'),
      time?: long(name='Time', description='The time when the custom event occurred.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552267615000'),
    }
  ](name='CustomEventCount')
  }(name='CustomEventCounts', description='The details of the custom event.'),
  message?: string(name='Message', description='The returned message. If the call was successful, the value success is returned. If the call failed, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='60912C8D-B340-4253-ADE7-61ACDFD25CFC'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DescribeCustomEventCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomEventCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of times that a custom event occurred in a specified time period.
 *
 * @description >  This operation counts the number of times that a custom event occurred for each service.
 *
 * @param request DescribeCustomEventCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomEventCountResponse
 */
async function describeCustomEventCountWithOptions(request: DescribeCustomEventCountRequest, runtime: Util.RuntimeOptions): DescribeCustomEventCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomEventCount',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of times that a custom event occurred in a specified time period.
 *
 * @description >  This operation counts the number of times that a custom event occurred for each service.
 *
 * @param request DescribeCustomEventCountRequest
 * @return DescribeCustomEventCountResponse
 */
async function describeCustomEventCount(request: DescribeCustomEventCountRequest): DescribeCustomEventCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomEventCountWithOptions(request, runtime);
}

model DescribeCustomEventHistogramRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552220485596'),
  eventId?: string(name='EventId', description='The ID of the custom event.', example='123'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
  level?: string(name='Level', description='The level of the custom event. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='CRITICAL'),
  name?: string(name='Name', description='The name of the custom event.', example='BucketIngressBandwidth'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are contained in the content of the custom event to query. You can use a logical operator between keywords.

*   If you need to query the custom event whose content contains a and b, set the value to a and b.
*   If you need to query the custom event whose content contains a or b, set the value to a or b.', example='cms'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552209685596'),
}

model DescribeCustomEventHistogramResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  eventHistograms?: {
    eventHistogram?: [ 
    {
      count?: long(name='Count', description='The information about the number of times that the custom event occurred during an interval of a time period.', example='3'),
      endTime?: long(name='EndTime', description='The end of an interval.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552226750000'),
      startTime?: long(name='StartTime', description='The beginning of an interval.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1552226740000'),
    }
  ](name='EventHistogram')
  }(name='EventHistograms', description='The information about the number of times that the custom event occurred during each interval of a time period.'),
  message?: string(name='Message', description='The returned message. If the call was successful, the value success is returned. If the call failed, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='486029C9-53E1-44B4-85A8-16A571A043FD'),
  success?: string(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DescribeCustomEventHistogramResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomEventHistogramResponseBody(name='body'),
}

/**
 * @summary Queries the number of times that a custom event occurred during each interval of a time period.
 *
 * @param request DescribeCustomEventHistogramRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomEventHistogramResponse
 */
async function describeCustomEventHistogramWithOptions(request: DescribeCustomEventHistogramRequest, runtime: Util.RuntimeOptions): DescribeCustomEventHistogramResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventId)) {
    query['EventId'] = request.eventId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomEventHistogram',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of times that a custom event occurred during each interval of a time period.
 *
 * @param request DescribeCustomEventHistogramRequest
 * @return DescribeCustomEventHistogramResponse
 */
async function describeCustomEventHistogram(request: DescribeCustomEventHistogramRequest): DescribeCustomEventHistogramResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomEventHistogramWithOptions(request, runtime);
}

model DescribeCustomMetricListRequest {
  dimension?: string(name='Dimension', description='The dimensions based on which the resources are queried.', example='{sampleName1=value1&amp;sampleName2=value2}'),
  groupId?: string(name='GroupId', description='The ID of the application group.

For information about how to query the IDs of application groups, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='7378****'),
  md5?: string(name='Md5', description='The MD5 value of the HTTP request body. The MD5 value is a 128-bit hash value used to verify the uniqueness of the reported monitoring data.', example='97c25982d9745a231276bff27469****'),
  metricName?: string(name='MetricName', description='The name of the custom metric.', example='cpu_total'),
  pageNumber?: string(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.

Pages start from page 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeCustomMetricListResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='1AF425E4-1DEA-54F2-910A-8117C9686140'),
  result?: string(name='Result', description='The reported custom metrics that are found in the query.', example='{\\\\"all\\\\":0,\\\\"size\\\\":10,\\\\"param\\\\":{\\\\"metric\\\\":\\\\"{\\\\\\\\\\\\"metricName\\\\\\\\\\\\":\\\\\\\\\\\\"cpu_total\\\\\\\\\\\\",\\\\\\\\\\\\"groupId\\\\\\\\\\\\":7378****,\\\\\\\\\\\\"project\\\\\\\\\\\\":\\\\\\\\\\\\"acs_customMetric_120886317861****\\\\\\\\\\\\",\\\\\\\\\\\\"dimension\\\\\\\\\\\\":\\\\\\\\\\\\"sampleName1=value1&sampleName2=value2\\\\\\\\\\\\",\\\\\\\\\\\\"status\\\\\\\\\\\\":1}\\\\",\\\\"service\\\\":\\\\"metric-center.aliyun-inc.com\\\\"},\\\\"page\\\\":1,\\\\"list\\\\":[]}'),
}

model DescribeCustomMetricListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeCustomMetricListResponseBody(name='body'),
}

/**
 * @summary Queries the reported monitoring data.
 *
 * @description >  You can call the DescribeMetricList operation to query the metrics of cloud services. For more information, see [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html).
 *
 * @param request DescribeCustomMetricListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeCustomMetricListResponse
 */
async function describeCustomMetricListWithOptions(request: DescribeCustomMetricListRequest, runtime: Util.RuntimeOptions): DescribeCustomMetricListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dimension)) {
    query['Dimension'] = request.dimension;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.md5)) {
    query['Md5'] = request.md5;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCustomMetricList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the reported monitoring data.
 *
 * @description >  You can call the DescribeMetricList operation to query the metrics of cloud services. For more information, see [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html).
 *
 * @param request DescribeCustomMetricListRequest
 * @return DescribeCustomMetricListResponse
 */
async function describeCustomMetricList(request: DescribeCustomMetricListRequest): DescribeCustomMetricListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCustomMetricListWithOptions(request, runtime);
}

model DescribeDynamicTagRuleListRequest {
  dynamicTagRuleId?: string(name='DynamicTagRuleId', description='The ID of the tag rule.', example='004155fa-15ba-466d-b61a-***********'),
  pageNumber?: string(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries to return on each page.

Minimum value: 1. Default value: 30.', example='30'),
  tagKey?: string(name='TagKey', description='The tag key.

For more information about how to obtain a tag key, see [DescribeTagKeyList](https://help.aliyun.com/document_detail/145558.html).', example='tagkey1'),
  tagRegionId?: string(name='TagRegionId', description='The ID of the region to which the tags belong.', example='cn-hangzhou'),
  tagValue?: string(name='TagValue', description='The tag value.

For more information about how to obtain a tag value, see [DescribeTagKeyList](https://help.aliyun.com/document_detail/145557.html).', example='*'),
}

model DescribeDynamicTagRuleListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  pageNumber?: string(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0D50523D-8D59-4A61-B58E-E2286ECFB3A9'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  tagGroupList?: {
    tagGroup?: [ 
    {
      contactGroupList?: {
        contactGroupList?: [ string ](name='ContactGroupList')
      }(name='ContactGroupList', description='The alert contact group.'),
      dynamicTagRuleId?: string(name='DynamicTagRuleId', description='The ID of the tag rule.', example='1536df65-a719-429d-8813-73cc40d7****'),
      matchExpress?: {
        matchExpress?: [ 
        {
          tagKey?: string(name='TagKey', description='The tag key.', example='azone-version'),
          tagValue?: string(name='TagValue', description='The tag value.

The `TagValue` and `TagValueMatchFunction` parameters must be used in pairs.', example='*'),
          tagValueMatchFunction?: string(name='TagValueMatchFunction', description='The method that is used to match tag values. Valid values:

*   all: includes all
*   startWith: starts with a prefix
*   endWith: ends with a suffix
*   contains: contains
*   notContains: does not contain
*   equals: equals', example='all'),
        }
      ](name='MatchExpress')
      }(name='MatchExpress', description='The conditional expressions used to create an application group based on the tag.'),
      matchExpressFilterRelation?: string(name='MatchExpressFilterRelation', description='The logical operator that is used between conditional expressions. Valid values:

*   `and`
*   `or`

>  Only one logical operator can be used in a request.', example='or'),
      regionId?: string(name='RegionId', description='The ID of the region to which the tags belong.', example='cn-hangzhou'),
      status?: string(name='Status', description='The status of adding instances that meet the tag rule to the application group. Valid values:

*   `RUNNING`
*   `FINISH`', example='FINISH'),
      tagKey?: string(name='TagKey', description='The tag key.', example='tagkey1'),
      tagValueBlacklist?: {
        tagValueBlacklist?: [ string ](name='TagValueBlacklist')
      }(name='TagValueBlacklist'),
      templateIdList?: {
        templateIdList?: [ string ](name='TemplateIdList')
      }(name='TemplateIdList', description='The IDs of the alert templates.'),
    }
  ](name='TagGroup')
  }(name='TagGroupList', description='The tag rules of application groups.'),
  total?: int32(name='Total', description='The total number of returned entries.', example='2'),
}

model DescribeDynamicTagRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDynamicTagRuleListResponseBody(name='body'),
}

/**
 * @summary Queries tag rules.
 *
 * @description This topic provides an example to show how to query tag rules that are related to `tagkey1`. The sample responses indicate that two tag rules are found. The rule IDs are `1536df65-a719-429d-8813-73cc40d7****` and `56e8cebb-b3d7-4a91-9880-78a8c84f****`.
 *
 * @param request DescribeDynamicTagRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDynamicTagRuleListResponse
 */
async function describeDynamicTagRuleListWithOptions(request: DescribeDynamicTagRuleListRequest, runtime: Util.RuntimeOptions): DescribeDynamicTagRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dynamicTagRuleId)) {
    query['DynamicTagRuleId'] = request.dynamicTagRuleId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  if (!Util.isUnset(request.tagRegionId)) {
    query['TagRegionId'] = request.tagRegionId;
  }
  if (!Util.isUnset(request.tagValue)) {
    query['TagValue'] = request.tagValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDynamicTagRuleList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries tag rules.
 *
 * @description This topic provides an example to show how to query tag rules that are related to `tagkey1`. The sample responses indicate that two tag rules are found. The rule IDs are `1536df65-a719-429d-8813-73cc40d7****` and `56e8cebb-b3d7-4a91-9880-78a8c84f****`.
 *
 * @param request DescribeDynamicTagRuleListRequest
 * @return DescribeDynamicTagRuleListResponse
 */
async function describeDynamicTagRuleList(request: DescribeDynamicTagRuleListRequest): DescribeDynamicTagRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDynamicTagRuleListWithOptions(request, runtime);
}

model DescribeEventRuleAttributeRequest {
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the event-triggered alert rule.

For information about how to obtain the name of an event-triggered alert rule, see [DescribeEventRuleList](https://help.aliyun.com/document_detail/114996.html).

This parameter is required.', example='testRule'),
  silenceTime?: string(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met.

Unit: seconds. Default value: 86400, which indicates one day.

>  Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.', example='86400'),
}

model DescribeEventRuleAttributeResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The alert does not exist.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9AA3F210-C03D-4C86-8DB6-21C84FF692A1'),
  result?: {
    description?: string(name='Description', description='The description of the event-triggered alert rule.', example='Default group event rule.'),
    eventPattern?: {
      eventTypeList?: {
        eventTypeList?: [ string ](name='EventTypeList')
      }(name='EventTypeList', description='The types of the event-triggered alert rules.'),
      keywordFilterObj?: {
        keywords?: {
          keyword?: [ string ](name='keyword')
        }(name='Keywords', description='The keywords that are used to match events.'),
        relation?: string(name='Relation', description='The relationship between multiple keywords in a condition. Valid values:

*   OR: The relationship between keywords is OR.
*   NOT: The keyword is excluded. The value NOT indicates that all events that do not contain the keywords are matched.', example='OR'),
      }(name='KeywordFilterObj', description='The keyword for filtering.'),
      levelList?: {
        levelList?: [ string ](name='LevelList')
      }(name='LevelList'),
      nameList?: {
        nameList?: [ string ](name='NameList')
      }(name='NameList'),
      product?: string(name='Product', description='The name of the cloud service.', example='CloudMonitor'),
      SQLFilter?: string(name='SQLFilter', description='Indicates that logs are filtered based on the specified SQL statement. If the specified conditions are met, an alert is triggered.', example='ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222'),
      statusList?: {
        statusList?: [ string ](name='StatusList')
      }(name='StatusList'),
    }(name='EventPattern', description='The event pattern. This parameter describes the trigger conditions of an event.'),
    eventType?: string(name='EventType', description='The event type. Valid values:

*   SYSTEM: system event
*   CUSTOM: custom event', example='SYSTEM'),
    groupId?: string(name='GroupId', description='The ID of the application group.', example='3607****'),
    name?: string(name='Name', description='The name of the event-triggered alert rule.', example='test_DefaultEventRule_7378****'),
    state?: string(name='State', description='The status of the event-triggered alert rule. Valid values:

*   ENABLED
*   DISABLED', example='ENABLED'),
  }(name='Result', description='The details of the event-triggered alert rule.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeEventRuleAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEventRuleAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of an event-triggered alert rule.
 *
 * @description This topic provides an example to show how to query the details of an event-triggered alert rule named `testRule`.
 *
 * @param request DescribeEventRuleAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEventRuleAttributeResponse
 */
async function describeEventRuleAttributeWithOptions(request: DescribeEventRuleAttributeRequest, runtime: Util.RuntimeOptions): DescribeEventRuleAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEventRuleAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an event-triggered alert rule.
 *
 * @description This topic provides an example to show how to query the details of an event-triggered alert rule named `testRule`.
 *
 * @param request DescribeEventRuleAttributeRequest
 * @return DescribeEventRuleAttributeResponse
 */
async function describeEventRuleAttribute(request: DescribeEventRuleAttributeRequest): DescribeEventRuleAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEventRuleAttributeWithOptions(request, runtime);
}

model DescribeEventRuleListRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.', example='7378****'),
  isEnable?: boolean(name='IsEnable', description='Specifies whether to enable the event-triggered alert rule. Valid values:

- true (default)
- false', example='true'),
  namePrefix?: string(name='NamePrefix', description='The prefix in the name of the event-triggered alert rule.', example='test'),
  pageNumber?: string(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.

Pages start from page 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeEventRuleListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  eventRules?: {
    eventRule?: [ 
    {
      description?: string(name='Description', description='The description of the event-triggered alert rule.', example='Default group event rule.'),
      eventPattern?: {
        eventPattern?: [ 
        {
          customFilters?: string(name='CustomFilters', description='The custom filter conditions.', example='ECS123'),
          eventTypeList?: {
            eventTypeList?: [ string ](name='EventTypeList')
          }(name='EventTypeList', description='The types of the event-triggered alert rules.'),
          keywordFilter?: {
            keywords?: {
              keywords?: [ string ](name='Keywords')
            }(name='Keywords', description='The keywords that are used to match events.'),
            relation?: string(name='Relation', description='The relationship between multiple keywords in a condition. Valid values:

*   OR: The relationship between keywords is OR.
*   NOT: The keyword is excluded. The value NOT indicates that all events that do not contain the keywords are matched.', example='OR'),
          }(name='KeywordFilter', description='The keyword for filtering.'),
          levelList?: {
            levelList?: [ string ](name='LevelList')
          }(name='LevelList', description='The levels of the event-triggered alerts.'),
          nameList?: {
            nameList?: [ string ](name='NameList')
          }(name='NameList', description='The event names.'),
          product?: string(name='Product', description='The abbreviation of the Alibaba Cloud service name.', example='CloudMonitor'),
          SQLFilter?: string(name='SQLFilter', description='Indicates that logs are filtered based on the specified SQL statement. If the specified conditions are met, an alert is triggered.', example='ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222'),
        }
      ](name='EventPattern')
      }(name='EventPattern', description='The mode of the event-triggered alert rule.'),
      eventType?: string(name='EventType', description='The type of the event-triggered alert rule. Valid values:

*   SYSTEM: system event-triggered alert rule
*   CUSTOM: custom event-triggered alert rule', example='SYSTEM'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='7378****'),
      name?: string(name='Name', description='The name of the event-triggered alert rule.', example='test_DefaultEventRule_7378****'),
      silenceTime?: long(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met.', example='86400'),
      state?: string(name='State', description='The status of the event-triggered alert rule. Valid values:

*   ENABLED
*   DISABLED', example='ENABLED'),
    }
  ](name='EventRule')
  }(name='EventRules', description='The event-triggered alert rule.'),
  message?: string(name='Message', description='The error message returned.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D0E6D82B-16B5-422A-8136-EE5BDC01E415'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='21'),
}

model DescribeEventRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEventRuleListResponseBody(name='body'),
}

/**
 * @summary Queries event-triggered alert rules.
 *
 * @param request DescribeEventRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEventRuleListResponse
 */
async function describeEventRuleListWithOptions(request: DescribeEventRuleListRequest, runtime: Util.RuntimeOptions): DescribeEventRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.isEnable)) {
    query['IsEnable'] = request.isEnable;
  }
  if (!Util.isUnset(request.namePrefix)) {
    query['NamePrefix'] = request.namePrefix;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEventRuleList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries event-triggered alert rules.
 *
 * @param request DescribeEventRuleListRequest
 * @return DescribeEventRuleListResponse
 */
async function describeEventRuleList(request: DescribeEventRuleListRequest): DescribeEventRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEventRuleListWithOptions(request, runtime);
}

model DescribeEventRuleTargetListRequest {
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the event-triggered alert rule.

This parameter is required.', example='testRule'),
}

model DescribeEventRuleTargetListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  contactParameters?: {
    contactParameter?: [ 
    {
      contactGroupName?: string(name='ContactGroupName', description='The name of the alert group.'),
      id?: string(name='Id', description='The ID of the recipient.', example='1'),
      level?: string(name='Level', description='The alert notification methods. Valid values:

4: Alert notifications are sent by using DingTalk chatbots and emails.', example='3'),
    }
  ](name='ContactParameter')
  }(name='ContactParameters', description='The information about the recipients if alert notifications are sent to the alert contacts of an alert contact group.'),
  fcParameters?: {
    FCParameter?: [ 
    {
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the function. 

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields: 

- Service: the code of an Alibaba Cloud service
- Region: the region ID
- Account: the ID of an Alibaba Cloud account
- ResourceType: the resource type
- ResourceId: the resource ID'),
      functionName?: string(name='FunctionName', description='The name of the function.', example='fcTest1'),
      id?: string(name='Id', description='The ID of the recipient.', example='3'),
      region?: string(name='Region', description='The region where Function Compute is deployed.', example='cn-qingdao'),
      serviceName?: string(name='ServiceName', description='The name of the Function Compute service.', example='service1'),
    }
  ](name='FCParameter')
  }(name='FcParameters', description='The information about the recipients in Function Compute.'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  mnsParameters?: {
    mnsParameter?: [ 
    {
      arn?: string(name='Arn', description='The ARN of the MNS queue. 

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields: 

- Service: the code of an Alibaba Cloud service
- Region: the region ID
- Account: the ID of an Alibaba Cloud account
- ResourceType: the resource type
- ResourceId: the resource ID'),
      id?: string(name='Id', description='The ID of the recipient.', example='2'),
      queue?: string(name='Queue', description='The name of the SMQ queue.', example='testQueue'),
      region?: string(name='Region', description='The region for SMQ.', example='cn-hangzhou'),
      topic?: string(name='Topic', description='The SMQ topic.', example='topic_sample'),
    }
  ](name='MnsParameter')
  }(name='MnsParameters', description='The notifications of Simple Message Queue (formerly MNS) (SMQ).'),
  openApiParameters?: {
    openApiParameters?: [ 
    {
      action?: string(name='Action', description='The name of the API operation.', example='PutLogs'),
      arn?: string(name='Arn', description='The ARN of the API operation. 

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields: 

- Service: the code of an Alibaba Cloud service
- Region: the region ID
- Account: the ID of an Alibaba Cloud account
- ResourceType: the resource type
- ResourceId: the resource ID The ARN of the Log Service Logstore. 

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields:
- Service: the code of an Alibaba Cloud service
- Region: the region ID
- Account: the ID of an Alibaba Cloud account
- ResourceType: the resource type
- ResourceId: the resource ID'),
      id?: string(name='Id', description='The ID of the recipient.', example='3'),
      product?: string(name='Product', description='The ID of the cloud service to which the API operation belongs.', example='log'),
      region?: string(name='Region', description='The region where the resource resides.', example='cn-hangzhou'),
      role?: string(name='Role', description='The name of the role.', example='MyRole'),
      version?: string(name='Version', description='The version of the API.', example='2019-01-01'),
    }
  ](name='OpenApiParameters')
  }(name='OpenApiParameters', description='The information about the recipients in OpenAPI Explorer.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='87170bc7-e28a-4c93-b9bf-90a1dbe84736'),
  slsParameters?: {
    slsParameter?: [ 
    {
      arn?: string(name='Arn', description='The ARN of the Log Service Logstore. 

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields: 

- Service: the code of an Alibaba Cloud service
- Region: the region ID
- Account: the ID of an Alibaba Cloud account
- ResourceType: the resource type
- ResourceId: the resource ID'),
      id?: string(name='Id', description='The ID of the recipient.', example='4'),
      logStore?: string(name='LogStore', description='The name of the Logstore.', example='logstore_test'),
      project?: string(name='Project', description='The name of the project.', example='project_test'),
      region?: string(name='Region', description='The ID of the region where the Log Service project resides.', example='cn-hangzhou'),
    }
  ](name='SlsParameter')
  }(name='SlsParameters', description='The information about the recipients in Log Service.'),
  webhookParameters?: {
    webhookParameter?: [ 
    {
      id?: string(name='Id', description='The ID of the recipient.', example='5'),
      method?: string(name='Method', description='The HTTP request method. Valid values: GET and POST.', example='GET'),
      protocol?: string(name='Protocol', description='The protocol type.', example='HTTP'),
      url?: string(name='Url', description='The callback URL.', example='http://www.aliyun.com'),
    }
  ](name='WebhookParameter')
  }(name='WebhookParameters', description='The information about the recipients if alert notifications are sent by sending a request to a callback URL.'),
}

model DescribeEventRuleTargetListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEventRuleTargetListResponseBody(name='body'),
}

/**
 * @summary Queries event-triggered alert rules.
 *
 * @description This topic provides an example to show how to query the details of an event-triggered alert rule named `testRule`.
 *
 * @param request DescribeEventRuleTargetListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEventRuleTargetListResponse
 */
async function describeEventRuleTargetListWithOptions(request: DescribeEventRuleTargetListRequest, runtime: Util.RuntimeOptions): DescribeEventRuleTargetListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEventRuleTargetList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries event-triggered alert rules.
 *
 * @description This topic provides an example to show how to query the details of an event-triggered alert rule named `testRule`.
 *
 * @param request DescribeEventRuleTargetListRequest
 * @return DescribeEventRuleTargetListResponse
 */
async function describeEventRuleTargetList(request: DescribeEventRuleTargetListRequest): DescribeEventRuleTargetListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEventRuleTargetListWithOptions(request, runtime);
}

model DescribeExporterOutputListRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeExporterOutputListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.', example='200'),
  datapoints?: {
    datapoint?: [ 
    {
      configJson?: {
        ak?: string(name='ak', description='The AccessKey ID.', example='LTAIpY33********'),
        endpoint?: string(name='endpoint', description='The Log Service endpoint to which the monitoring data is exported.', example='http://cn-qingdao-share.log.aliyuncs.com'),
        logstore?: string(name='logstore', description='The Logstore.', example='monitorlogstore'),
        project?: string(name='project', description='The Log Service project to which the monitoring data is exported.', example='exporter'),
      }(name='ConfigJson', description='The JSON object that contains the details about the destination to which the monitoring data is exported.'),
      createTime?: long(name='CreateTime', description='The time when the configuration set was created. The value is a UNIX timestamp.', example='1584016495498'),
      destName?: string(name='DestName', description='The name of the configuration set.', example='exporterOut'),
      destType?: string(name='DestType', description='The service to which the monitoring data is exported.

> Only Log Service is supported. More services will be supported in the future.', example='SLS'),
    }
  ](name='Datapoint')
  }(name='Datapoints', description='The configuration sets for exporting monitoring data.'),
  message?: string(name='Message', description='The returned message.', example='sucess'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='0E657631-CD6C-4C24-9637-98D000B9272C'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
  total?: int32(name='Total', description='The total number of returned entries.', example='25'),
}

model DescribeExporterOutputListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExporterOutputListResponseBody(name='body'),
}

/**
 * @summary Queries configuration sets that are used to export monitoring data.
 *
 * @param request DescribeExporterOutputListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExporterOutputListResponse
 */
async function describeExporterOutputListWithOptions(request: DescribeExporterOutputListRequest, runtime: Util.RuntimeOptions): DescribeExporterOutputListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExporterOutputList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries configuration sets that are used to export monitoring data.
 *
 * @param request DescribeExporterOutputListRequest
 * @return DescribeExporterOutputListResponse
 */
async function describeExporterOutputList(request: DescribeExporterOutputListRequest): DescribeExporterOutputListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExporterOutputListWithOptions(request, runtime);
}

model DescribeExporterRuleListRequest {
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 1000.', example='1000'),
  regionId?: string(name='RegionId'),
}

model DescribeExporterRuleListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful. Other status codes indicate that the request failed.', example='200'),
  datapoints?: {
    datapoint?: [ 
    {
      createTime?: long(name='CreateTime', description='The time when the rule was created. The value is a UNIX timestamp.', example='1584024616228'),
      describe?: string(name='Describe', description='The description of the rule.', example='Export monitoring data'),
      dimension?: string(name='Dimension', description='The associated dimensions.', example='{"instanceId":"xxxxx"}'),
      dstName?: {
        dstName?: [ string ](name='DstName')
      }(name='DstName'),
      enabled?: boolean(name='Enabled', description='Indicates whether the rule is enabled.', example='true'),
      metricName?: string(name='MetricName', description='The name of the metric.

> For more information, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/28619.html).', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the service.

> For more information, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/28619.html).', example='acs_ecs_dashboard'),
      ruleName?: string(name='RuleName', description='The name of the data export rule.', example='myRuleName'),
      targetWindows?: string(name='TargetWindows', description='The time window of the exported data.\\\\
Multiple windows are separated with commas (,).

> Data in a time window of less than 60 seconds cannot be exported.', example='60,300'),
    }
  ](name='Datapoint')
  }(name='Datapoints', description='The details of the data export rules.'),
  message?: string(name='Message', description='The returned message.', example='susscess'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='6BA047CA-8BC6-40BC-BC8F-FBECF35F1993'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   `true`
*   `false`', example='true'),
  total?: int32(name='Total', description='The total number of returned entries.', example='1000'),
}

model DescribeExporterRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeExporterRuleListResponseBody(name='body'),
}

/**
 * @summary Queries data export rules.
 *
 * @param request DescribeExporterRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeExporterRuleListResponse
 */
async function describeExporterRuleListWithOptions(request: DescribeExporterRuleListRequest, runtime: Util.RuntimeOptions): DescribeExporterRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeExporterRuleList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries data export rules.
 *
 * @param request DescribeExporterRuleListRequest
 * @return DescribeExporterRuleListResponse
 */
async function describeExporterRuleList(request: DescribeExporterRuleListRequest): DescribeExporterRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeExporterRuleListWithOptions(request, runtime);
}

model DescribeGroupMonitoringAgentProcessRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='12345'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  processName?: string(name='ProcessName', description='The process name.', example='sshd'),
  regionId?: string(name='RegionId'),
}

model DescribeGroupMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The HTTP status codes.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  pageNumber?: string(name='PageNumber', description='The page number. Default value: 1', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  processes?: {
    process?: [ 
    {
      alertConfig?: {
        alertConfig?: [ 
        {
          comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday.
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective.', example='00:00-23:59'),
          escalationsLevel?: string(name='EscalationsLevel', description='The level of the alert. Valid values:

*   critical
*   warn
*   Info', example='warn'),
          noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective.', example='00:00-23:59'),
          silenceTime?: string(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met. Unit: seconds. Minimum value: 3600, which is equivalent to one hour. Default value: 86400, which is equivalent to one day.

>  Only one alert notification is sent during each mute period even if the metric value exceeds the alert threshold several times.', example='86400'),
          statistics?: string(name='Statistics', description='The method used to calculate metric values that trigger alerts.', example='Average'),
          targetList?: {
            target?: [ 
            {
              arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource. Format: acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message. Example: acs:mns:cn-hangzhou:120886317861\\\\*\\\\*\\\\*\\\\*:/queues/test123/message. Fields:

*   {Service name abbreviation}: the abbreviation of the service name. Set the value to Simple Message Queue (formerly MNS) (SMQ).

*   {userId}: the ID of the Alibaba Cloud account.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {Resource type}: the type of the resource for which alerts are triggered. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
              id?: string(name='Id', description='The ID of the resource for which alerts are triggered.', example='123'),
              jsonParmas?: string(name='JsonParmas', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
              level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='CRITICAL'),
            }
          ](name='Target')
          }(name='TargetList', description='The resources for which alerts are triggered.'),
          threshold?: string(name='Threshold', description='The alert threshold.', example='5'),
          times?: string(name='Times', description='The number of times for which the threshold can be consecutively exceeded.

>  A metric triggers an alert only after the metric value reaches the threshold consecutively for the specified times.', example='3'),
          webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='http://www.aliyun.com'),
        }
      ](name='AlertConfig')
      }(name='AlertConfig', description='The alert rule configurations.'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
      id?: string(name='Id', description='The ID of the process monitoring task.', example='3F6150F9-45C7-43F9-9578-A58B2E72****'),
      matchExpress?: {
        matchExpress?: [ 
        {
          function?: string(name='Function', description='The matching condition. Valid values:

*   all (default): matches all
*   startWith: starts with a prefix
*   endWith: ends with a suffix
*   contains: contains
*   notContains: excludes
*   equals: equals

>  The matched instances are monitored by the process monitoring task.', example='all'),
          name?: string(name='Name', description='The criteria based on which the instances are matched.

>  Set the value to `name`. The value name indicates that the instances are matched based on the instance name.', example='name'),
          value?: string(name='Value', description='The keyword used to match the instance name.', example='portalHost'),
        }
      ](name='MatchExpress')
      }(name='MatchExpress', description='The matching conditions.

>  Only the instances that meet the conditional expressions are monitored by the process monitoring task.'),
      matchExpressFilterRelation?: string(name='MatchExpressFilterRelation', description='The logical operator used between conditional expressions that are used to match instances. Valid values:

*   all
*   and
*   or', example='and'),
      processName?: string(name='ProcessName', description='The process name.', example='sshd'),
    }
  ](name='Process')
  }(name='Processes', description='The process monitoring tasks.'),
  requestId?: string(name='RequestId', description='The request ID.', example='7985D471-3FA8-4EE9-8F4B-45C19DF3D36F'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: Valid values: true and false.', example='true'),
  total?: string(name='Total', description='The total number of returned entries.', example='28'),
}

model DescribeGroupMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeGroupMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @summary Queries the process monitoring tasks for an application group.
 *
 * @description You can create a process monitoring task to monitor all or the specified Elastic Compute Service (ECS) instances in an application group and configure alert rules for the process monitoring task.
 *
 * @param request DescribeGroupMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeGroupMonitoringAgentProcessResponse
 */
async function describeGroupMonitoringAgentProcessWithOptions(request: DescribeGroupMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): DescribeGroupMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.processName)) {
    query['ProcessName'] = request.processName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGroupMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the process monitoring tasks for an application group.
 *
 * @description You can create a process monitoring task to monitor all or the specified Elastic Compute Service (ECS) instances in an application group and configure alert rules for the process monitoring task.
 *
 * @param request DescribeGroupMonitoringAgentProcessRequest
 * @return DescribeGroupMonitoringAgentProcessResponse
 */
async function describeGroupMonitoringAgentProcess(request: DescribeGroupMonitoringAgentProcessRequest): DescribeGroupMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGroupMonitoringAgentProcessWithOptions(request, runtime);
}

model DescribeHostAvailabilityListRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.', example='12345'),
  id?: long(name='Id', description='The ID of the availability monitoring task.', example='123456'),
  ids?: string(name='Ids', description='The IDs of the availability monitoring tasks. Separate multiple IDs with commas (,).', example='123456,345678'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Minimum value: 1. Default value: 10', example='10'),
  regionId?: string(name='RegionId'),
  taskName?: string(name='TaskName', description='The name of the availability monitoring task.', example='ecs_instance'),
}

model DescribeHostAvailabilityListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4A288E86-45C3-4858-9DB0-6D85B10BD92A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskList?: {
    nodeTaskConfig?: [ 
    {
      alertConfig?: {
        endTime?: int32(name='EndTime', description='The end of the time period during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

>  Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='22'),
        escalationList?: {
          escalationList?: [ 
          {
            aggregate?: string(name='Aggregate', description='The method used to calculate metric values that trigger alerts. Valid values:

*   Value: the value of the HTTP status code
*   Average: the average HTTP response time
*   Value: the value of the Telnet status code
*   TelnetLatency: the average Telnet response time
*   Average: the average Ping packet loss rate', example='Value'),
            metricName?: string(name='MetricName', description='The name of the metric. Valid values:

*   HttpStatus
*   HttpLatency
*   TelnetStatus
*   TelnetLatency
*   PingLostRate', example='HttpStatus'),
            operator?: string(name='Operator', description='The comparison operator that is used in the alert rule. Valid values:

*   `>`
*   `>=`
*   `<`
*   `<=`
*   `=`', example='='),
            times?: string(name='Times', description='The consecutive number of times for which the metric value is measured before an alert is triggered.', example='3'),
            value?: string(name='Value', description='The alert threshold.', example='400'),
          }
        ](name='escalationList')
        }(name='EscalationList', description='The trigger conditions of the alert rule.'),
        notifyType?: int32(name='NotifyType', description='The alert notification methods. Valid values:

*   2: Alert notifications are sent by using emails and DingTalk chatbots.
*   1: Alert notifications are sent by using emails and DingTalk chatbots.
*   0: Alert notifications are sent by using emails and DingTalk chatbots.', example='0'),
        silenceTime?: int32(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400.', example='86400'),
        startTime?: int32(name='StartTime', description='The beginning of the time period during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

>  Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='0'),
        targetList?: {
          target?: [ 
          {
            arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the function.

Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields:

*   Service: the service code
*   Region: the region ID
*   Account: the ID of the Alibaba Cloud account
*   ResourceType: the resource type
*   ResourceId: the resource ID.', example='acs:mns:cn-hangzhou:17754132319*****:/queues/test/messages'),
            id?: string(name='Id', description='The ID of the resource that triggers the alert.', example='1'),
            jsonParams?: string(name='JsonParams', description='The JSON-formatted parameters of the alert callback.', example='{"key1":"value1"}'),
            level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='INFO'),
          }
        ](name='Target')
        }(name='TargetList', description='The monitored resources.'),
        webHook?: string(name='WebHook', description='The callback URL.

CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.', example='https://www.aliyun.com'),
      }(name='AlertConfig', description='The configurations of the alert rule.'),
      disabled?: boolean(name='Disabled', description='Indicates whether the availability monitoring task is disabled. Valid values:

*   true: The availability monitoring task is disabled.
*   false: The availability monitoring task is enabled.', example='false'),
      groupId?: long(name='GroupId', description='The ID of the application group.', example='12345'),
      groupName?: string(name='GroupName', description='The name of the application group.', example='Group_ECS'),
      id?: long(name='Id', description='The ID of the availability monitoring task.', example='123456'),
      instances?: {
        instance?: [ string ](name='Instance')
      }(name='Instances', description='The ECS instances that are monitored.'),
      taskName?: string(name='TaskName', description='The name of the availability monitoring task.', example='ecs_instance'),
      taskOption?: {
        httpKeyword?: string(name='HttpKeyword', description='The response to the HTTP request.', example='OK'),
        httpMethod?: string(name='HttpMethod', description='The HTTP request method. Valid values:

*   GET
*   POST
*   HEAD', example='GET'),
        httpNegative?: boolean(name='HttpNegative', description='The method to trigger an alert. The alert can be triggered based on whether the specified alert rule is included in the response body. Valid values:

*   true: If the HTTP response body includes the alert rule, an alert is triggered.
*   false: If the HTTP response does not include the alert rule, an alert is triggered.', example='true'),
        httpPostContent?: string(name='HttpPostContent', description='The content of the HTTP POST request.', example='params1=paramsValue1'),
        httpResponseCharset?: string(name='HttpResponseCharset', description='The character set that is used in the HTTP response.', example='UTF-8'),
        httpURI?: string(name='HttpURI', description='The URI that you want to monitor. If the TaskType parameter is set to HTTP, this parameter is required.', example='https://www.aliyun.com'),
        interval?: int32(name='Interval', description='The interval at which detection requests are sent. Unit: seconds.', example='60'),
        telnetOrPingHost?: string(name='TelnetOrPingHost', description='The domain name or IP address that you want to monitor.', example='ssh.aliyun.com'),
      }(name='TaskOption', description='The optional parameters of the availability monitoring task.'),
      taskScope?: string(name='TaskScope', description='The range of instances that are monitored by the availability monitoring task. Valid values:

*   GROUP: All ECS instances in the application group are monitored.
*   GROUP_SPEC_INSTANCE: Specified ECS instances in the application group are monitored.', example='GROUP'),
      taskType?: string(name='TaskType', description='The task type. Valid values:

*   PING
*   TELNET
*   HTTP', example='HTTP'),
    }
  ](name='NodeTaskConfig')
  }(name='TaskList', description='The details of the availability monitoring tasks.'),
  total?: int32(name='Total', description='The total number of returned entries.', example='1'),
}

model DescribeHostAvailabilityListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHostAvailabilityListResponseBody(name='body'),
}

/**
 * @summary Queries availability monitoring tasks.
 *
 * @description This topic provides an example to show how to query all the availability monitoring tasks of your Alibaba Cloud account. The sample responses indicate that the account has one availability monitoring task named `ecs_instance`.
 *
 * @param request DescribeHostAvailabilityListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHostAvailabilityListResponse
 */
async function describeHostAvailabilityListWithOptions(request: DescribeHostAvailabilityListRequest, runtime: Util.RuntimeOptions): DescribeHostAvailabilityListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHostAvailabilityList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries availability monitoring tasks.
 *
 * @description This topic provides an example to show how to query all the availability monitoring tasks of your Alibaba Cloud account. The sample responses indicate that the account has one availability monitoring task named `ecs_instance`.
 *
 * @param request DescribeHostAvailabilityListRequest
 * @return DescribeHostAvailabilityListResponse
 */
async function describeHostAvailabilityList(request: DescribeHostAvailabilityListRequest): DescribeHostAvailabilityListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHostAvailabilityListWithOptions(request, runtime);
}

model DescribeHybridMonitorDataListRequest {
  end?: long(name='End', description='The end of the time range to query.

Unit: seconds.

This parameter is required.', example='1653805225'),
  namespace?: string(name='Namespace', description='The name of the namespace.

For more information about how to query the names of namespaces, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='default-aliyun'),
  period?: string(name='Period', description='The statistical period of the monitoring data.

Unit: seconds.', example='60'),
  promSQL?: string(name='PromSQL', description='The metric name.

>  PromQL statements are supported.

This parameter is required.', example='AliyunEcs_cpu_total'),
  regionId?: string(name='RegionId'),
  start?: long(name='Start', description='The start of the time range to query.

Unit: seconds.

This parameter is required.', example='1653804865'),
}

model DescribeHybridMonitorDataListResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='end timestamp must not be before start time.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C240412F-3F5F-50E2-ACEC-DE808EF9C4BE'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  timeSeries?: [ 
    {
      labels?: [ 
        {
          k?: string(name='K', description='The tag key.', example='instanceId'),
          v?: string(name='V', description='The tag value.', example='i-rj99xc6cptkk64ml****'),
        }
      ](name='Labels', description='The tags of the time dimension.'),
      metricName?: string(name='MetricName', description='The metric name.', example='AliyunEcs_cpu_total'),
      values?: [ 
        {
          ts?: string(name='Ts', description='The timestamp that indicates the time when the metric value is collected.

Unit: seconds.', example='1653804865'),
          v?: string(name='V', description='The metric value.', example='0.13'),
        }
      ](name='Values', description='The metric values that are collected at different timestamps.'),
    }
  ](name='TimeSeries', description='The returned monitoring data.'),
}

model DescribeHybridMonitorDataListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHybridMonitorDataListResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data in a namespace.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Limits
 * The size of monitoring data that is returned in each call cannot exceed 1.5 MB. If the returned data reaches the upper limit, the query fails. You must reset the query conditions.
 * # [](#)Description
 * This topic provides an example to show how to query the monitoring data of the `AliyunEcs_cpu_total` metric in the `default-aliyun` namespace from `1653804865` (14:14:25 on May 29, 2022) to `1653805225` (14:20:25 on May 29, 2022).
 *
 * @param request DescribeHybridMonitorDataListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHybridMonitorDataListResponse
 */
async function describeHybridMonitorDataListWithOptions(request: DescribeHybridMonitorDataListRequest, runtime: Util.RuntimeOptions): DescribeHybridMonitorDataListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.end)) {
    query['End'] = request.end;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.promSQL)) {
    query['PromSQL'] = request.promSQL;
  }
  if (!Util.isUnset(request.start)) {
    query['Start'] = request.start;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHybridMonitorDataList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring data in a namespace.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Limits
 * The size of monitoring data that is returned in each call cannot exceed 1.5 MB. If the returned data reaches the upper limit, the query fails. You must reset the query conditions.
 * # [](#)Description
 * This topic provides an example to show how to query the monitoring data of the `AliyunEcs_cpu_total` metric in the `default-aliyun` namespace from `1653804865` (14:14:25 on May 29, 2022) to `1653805225` (14:20:25 on May 29, 2022).
 *
 * @param request DescribeHybridMonitorDataListRequest
 * @return DescribeHybridMonitorDataListResponse
 */
async function describeHybridMonitorDataList(request: DescribeHybridMonitorDataListRequest): DescribeHybridMonitorDataListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHybridMonitorDataListWithOptions(request, runtime);
}

model DescribeHybridMonitorNamespaceListRequest {
  keyword?: string(name='Keyword', description='The search keyword.', example='aliyun'),
  namespace?: string(name='Namespace', description='The name of the namespace.

The name can contain letters, digits, and hyphens (-).', example='aliyun-test'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Page numbers start from 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Page numbers start from 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  showTaskStatistic?: boolean(name='ShowTaskStatistic', description='Specifies whether to return the configuration details of metric import tasks for Alibaba Cloud services and the number of metric import tasks for third-party services. Valid values:

*   true
*   false (default)', example='false'),
}

model DescribeHybridMonitorNamespaceListResponseBody = {
  code?: string(name='Code', description='The response code.', example='Success'),
  describeHybridMonitorNamespace?: [ 
    {
      aliyunProductMetricList?: [ 
        {
          namespaceList?: [ 
            {
              metricList?: [ 
                {
                  list?: [ string ](name='List', description='The metrics.'),
                  period?: long(name='Period', description='The collection period of the metric.

Unit: seconds.', example='60'),
                }
              ](name='MetricList', description='The metrics for the Alibaba Cloud service.'),
              namespace?: string(name='Namespace', description='The namespace for the Alibaba Cloud service.', example='acs_ecs_dashboard'),
            }
          ](name='NamespaceList', description='The namespaces.'),
          userId?: long(name='UserId', description='The account that is used to create the namespace.', example='120886317861****'),
          YAMLConfig?: string(name='YAMLConfig', description='The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.

*   namespace: the namespace of the Alibaba Cloud service.
*   metric_list: the metrics of the Alibaba Cloud service.
*   dimension: the resources of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring. If you do not specify a dimension, all resources of the Alibaba Cloud service are monitored.', example='products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total dimension: \\\\"\\\\"'),
        }
      ](name='AliyunProductMetricList', description='The configuration details of metric import tasks for Alibaba Cloud services.'),
      createTime?: string(name='CreateTime', description='The timestamp that was generated when the namespace was created.

Unit: milliseconds.', example='1652682744000'),
      description?: string(name='Description', description='The description of the namespace.', example='aliyun-test'),
      detail?: {
        namespaceRegion?: string(name='NamespaceRegion', description='The region where the metric data is stored.

>  This parameter is returned if you select `m_prom_user` for `NamespaceType` when you create a namespace.', example='cn-hangzhou'),
        SLSProject?: string(name='SLSProject', description='The project where the metric data is located.

>  This parameter is returned if you select `m_prom_user` for `NamespaceType` when you create a namespace.', example='cms-hybrid-120886317861****-cn-hangzhou-a83d'),
        spec?: string(name='Spec', description='The data retention period. Valid values:

*   cms.s1.large (Retention Period 15 Days)
*   cms.s1.xlarge (Retention Period 32 Days)
*   cms.s1.2xlarge (Retention Period 63 Days)
*   cms.s1.3xlarge (Retention Period 93 Days)
*   cms.s1.6xlarge (Retention Period 185 Days)
*   cms.s1.12xlarge (Retention Period 367 Days)', example='cms.s1.3xlarge'),
      }(name='Detail', description='The details of the data retention period.'),
      id?: string(name='Id', description='The ID of the namespace.', example='3****'),
      isDelete?: int32(name='IsDelete', description='Indicates whether the namespace is deleted. Valid values:

*   0: The namespace is not deleted.
*   1: The namespace is deleted.', example='0'),
      modifyTime?: string(name='ModifyTime', description='The timestamp that was generated when the namespace was last modified.', example='1652682744000'),
      namespace?: string(name='Namespace', description='The name of the namespace.', example='aliyun-test'),
      namespaceType?: string(name='NamespaceType', description='The storage scheme of metric data. Valid values:

*   m_prom_user: The metric data is stored in Simple Log Service.
*   m_prom_pool: The metric data is stored in the storage space provided by CloudMonitor.', example='m_prom_user'),
      notAliyunTaskNumber?: long(name='NotAliyunTaskNumber', description='The number of metric import tasks for third-party services.', example='0'),
    }
  ](name='DescribeHybridMonitorNamespace', description='The details of the namespaces.'),
  message?: string(name='Message', description='The returned message.', example='Specified parameter PageSize is not valid.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='1EC450A4-3221-5148-B77E-2827576CFE48'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='1'),
}

model DescribeHybridMonitorNamespaceListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHybridMonitorNamespaceListResponseBody(name='body'),
}

/**
 * @summary Queries namespaces and the details of the related metric import tasks.
 *
 * @description In this example, all namespaces within the current account are queried. The response shows that the current account has only one namespace named `aliyun-test`.
 *
 * @param request DescribeHybridMonitorNamespaceListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHybridMonitorNamespaceListResponse
 */
async function describeHybridMonitorNamespaceListWithOptions(request: DescribeHybridMonitorNamespaceListRequest, runtime: Util.RuntimeOptions): DescribeHybridMonitorNamespaceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.showTaskStatistic)) {
    query['ShowTaskStatistic'] = request.showTaskStatistic;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHybridMonitorNamespaceList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries namespaces and the details of the related metric import tasks.
 *
 * @description In this example, all namespaces within the current account are queried. The response shows that the current account has only one namespace named `aliyun-test`.
 *
 * @param request DescribeHybridMonitorNamespaceListRequest
 * @return DescribeHybridMonitorNamespaceListResponse
 */
async function describeHybridMonitorNamespaceList(request: DescribeHybridMonitorNamespaceListRequest): DescribeHybridMonitorNamespaceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHybridMonitorNamespaceListWithOptions(request, runtime);
}

model DescribeHybridMonitorSLSGroupRequest {
  keyword?: string(name='Keyword', description='The keyword that is used to search for Logstore groups.', example='Logstore'),
  pageNumber?: string(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.

Minimum value: 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  SLSGroupName?: string(name='SLSGroupName', description='The name of the Logstore group.', example='Logstore_test'),
}

model DescribeHybridMonitorSLSGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  list?: [ 
    {
      createTime?: string(name='CreateTime', description='The time when the Logstore group was created.

Unit: milliseconds.', example='1652845630000'),
      SLSGroupConfig?: [ 
        {
          SLSLogstore?: string(name='SLSLogstore', description='The Logstore.', example='Logstore-aliyun-all'),
          SLSProject?: string(name='SLSProject', description='The Simple Log Service project.', example='aliyun-project'),
          SLSRegion?: string(name='SLSRegion', description='The region ID.', example='cn-hangzhou'),
          SLSUserId?: string(name='SLSUserId', description='The member ID.

**Description** This parameter is returned when you call the operation by using an administrative account.', example='120886317861****'),
        }
      ](name='SLSGroupConfig', description='The configurations of the Logstore group.'),
      SLSGroupDescription?: string(name='SLSGroupDescription', description='The description of the Logstore group.'),
      SLSGroupName?: string(name='SLSGroupName', description='The name of the Logstore group.', example='Logstore_test'),
      updateTime?: string(name='UpdateTime', description='The time when the Logstore group was modified.

Unit: milliseconds.', example='1652845630000'),
    }
  ](name='List', description='The queried Logstore groups.'),
  message?: string(name='Message', description='The error message.', example='NotFound.SLSGroup'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='66683237-7126-50F8-BBF8-D67ACC919A17'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false'),
  total?: long(name='Total', description='The total number of entries returned.', example='2'),
}

model DescribeHybridMonitorSLSGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHybridMonitorSLSGroupResponseBody(name='body'),
}

/**
 * @summary Queries Logstore groups.
 *
 * @description In this example, all Logstore groups within the current account are queried. The response shows that the current account has two Logstore groups: `Logstore_test` and `Logstore_aliyun`.
 *
 * @param request DescribeHybridMonitorSLSGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHybridMonitorSLSGroupResponse
 */
async function describeHybridMonitorSLSGroupWithOptions(request: DescribeHybridMonitorSLSGroupRequest, runtime: Util.RuntimeOptions): DescribeHybridMonitorSLSGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.SLSGroupName)) {
    query['SLSGroupName'] = request.SLSGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHybridMonitorSLSGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries Logstore groups.
 *
 * @description In this example, all Logstore groups within the current account are queried. The response shows that the current account has two Logstore groups: `Logstore_test` and `Logstore_aliyun`.
 *
 * @param request DescribeHybridMonitorSLSGroupRequest
 * @return DescribeHybridMonitorSLSGroupResponse
 */
async function describeHybridMonitorSLSGroup(request: DescribeHybridMonitorSLSGroupRequest): DescribeHybridMonitorSLSGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHybridMonitorSLSGroupWithOptions(request, runtime);
}

model DescribeHybridMonitorTaskListRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.

For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='3607****'),
  includeAliyunTask?: boolean(name='IncludeAliyunTask', description='Specifies whether the returned result includes metric import tasks for Alibaba Cloud services. Valid values:

*   true (default): The returned result includes metric import tasks for Alibaba Cloud services.
*   false: The returned result excludes metric import tasks for Alibaba Cloud services.', example='true'),
  keyword?: string(name='Keyword', description='The keyword that is used for the search.', example='task'),
  namespace?: string(name='Namespace', description='The name of the namespace.

For information about how to obtain the name of a namespace, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).', example='aliyun'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Pages start from page 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  targetUserId?: long(name='TargetUserId', description='The ID of the member account.

> This parameter is required only if you use a management account to call this operation to delete the metric import tasks that belong to a member in a resource directory. In this case, the `TaskType` parameter is set to `aliyun_fc`.', example='120886317861****'),
  taskId?: string(name='TaskId', description='The ID of the metric import task.', example='36****'),
  taskType?: string(name='TaskType', description='The type of the metric import task. Valid values:

*   aliyun_fc: metric import tasks for Alibaba Cloud services
*   aliyun_sls: metrics for logs imported from Log Service', example='aliyun_fc'),
}

model DescribeHybridMonitorTaskListResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.

*   If the request was successful, the value `successful` is returned.
*   If the request failed, an error message is returned.', example='success'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='11145B76-566A-5D80-A8A3-FAD98D310079'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  taskList?: [ 
    {
      attachLabels?: [ 
        {
          name?: string(name='Name', description='The tag key.', example='key1'),
          value?: string(name='Value', description='The tag value.', example='value1'),
        }
      ](name='AttachLabels', description='The tags of the metric import task.'),
      collectInterval?: int32(name='CollectInterval', description='The interval at which the CloudMonitor agent collects host monitoring data. Valid values:

*   15
*   30
*   60

Unit: seconds.', example='60'),
      collectTargetEndpoint?: string(name='CollectTargetEndpoint', description='The URL of the destination from which the CloudMonitor agent collects host monitoring data.', example='http://localhost'),
      collectTargetPath?: string(name='CollectTargetPath', description='The relative path from which the CloudMonitor agent collects monitoring data.', example='/metrics'),
      collectTargetType?: string(name='CollectTargetType', description='The type of the monitoring data. Valid values: Spring, Tomcat, Nginx, Tengine, JVM, Redis, and MySQL.', example='nginx'),
      collectTimout?: int32(name='CollectTimout', description='The timeout period during which the CloudMonitor agent collects host monitoring data. Valid values:

*   0
*   15
*   30
*   60

Unit: seconds.', example='15'),
      createTime?: string(name='CreateTime', description='The timestamp when the metric import task was created.

Unit: milliseconds.', example='1639382496000'),
      description?: string(name='Description', description='The description of the metric import task.', example='aliyun'),
      extraInfo?: string(name='ExtraInfo', description='The additional information of the instance.', example='test'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='3607****'),
      instances?: [ string ](name='Instances', description='The instances where monitoring data is collected in batches.'),
      logFilePath?: string(name='LogFilePath', example='C:\\\\UserData\\\\log\\\\*.Log'),
      logProcess?: string(name='LogProcess', description='The method that is used to aggregate on-premises log data.', example='[{"metric": "metric1","filters": [{"column": "filed2","type": "include","values": ["222222"]}],"groupBys": [{"column": "filed3","name": "filed3"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]},{"metric": "metric2","filters": [{"column": "field1","type": "include","values": ["11111"]}],"groupBys": [{"column": "filed2","name": "filed2"}],"calculates": [{"column": "field1","name": "avg","type": "avg"}]}]'),
      logSample?: string(name='LogSample', description='The sample on-premises log.', example='{"logContent":"100.116.134.26 1119 - [13/Aug/2019:16:55:46 +0800] POST metrichub-cn-hongkong.aliyun.com /agent/metrics/putLines 200 0 \\\\"-\\\\" \\\\"127.0.0.1:7001\\\\" \\\\"Go-http-client/1.1\\\\" \\\\"-\\\\" \\\\"-\\\\" \\\\"0a98a21a15656865460656276e\\\\"","addData":{"field1":["1119","1119"],"filed2":["POSTx","POST"],"filed3":["true","200"]}}'),
      logSplit?: string(name='LogSplit', description='The result that is returned after on-premises log data is split based on the specified matching mode.

> The matching modes of on-premises log data include full regex mode, delimiter mode, and JSON mode.', example='{"type": "regex","regex": "\\\\\\\\d+\\\\\\\\.\\\\\\\\d+\\\\\\\\.\\\\\\\\d+\\\\\\\\.\\\\\\\\d+\\\\\\\\s+(\\\\\\\\d+)\\\\\\\\s+\\\\\\\\S+\\\\\\\\s+\\[\\\\\\\\d+/\\\\\\\\S+/\\\\\\\\d+:\\\\\\\\d+:\\\\\\\\d+:\\\\\\\\d+\\\\\\\\s+\\\\\\\\+\\\\\\\\d+\\\\\\\\]\\\\\\\\s+(\\\\\\\\S+)\\\\\\\\s+\\\\\\\\S+\\\\\\\\s+/\\\\\\\\S+/\\\\\\\\S+/\\\\\\\\S+\\\\\\\\s+(\\\\\\\\d+)","columns": [{"name": "field1"},{"name": "filed2","translate": {"default": "-","mappings": [{"from": "(\\\\\\\\w+)","to": "$1x","type": "regex"}]}},{"name": "filed3","translate": {"default": "-","mappings": [{"from": "NumberRange(100,300)","to": "true","type": "function"}]}}]}'),
      matchExpress?: [ 
        {
          function?: string(name='Function', description='The method that is used to match the instance name. Valid values:

*   startWith: starts with a prefix
*   endWith: ends with a suffix
*   all: matches all
*   equals: equals
*   contains: contains
*   notContains: does not contain', example='all'),
          name?: string(name='Name', description='The instance name.', example='name'),
          value?: string(name='Value', description='The keyword that corresponds to the instance name.', example='ECS_instance1'),
        }
      ](name='MatchExpress', description='The conditions that are used to match the instances in the application group.'),
      matchExpressRelation?: string(name='MatchExpressRelation', description='The relationship between the conditions that are used to filter metric import tasks. Valid values:

*   or
*   and', example='or'),
      namespace?: string(name='Namespace', description='The namespace to which the host belongs.', example='aliyun'),
      networkType?: string(name='NetworkType', description='The network type of the host. Valid values:

*   `vpc`
*   `Internet`', example='vpc'),
      SLSProcess?: string(name='SLSProcess', description='The configurations of the logs that are imported from Log Service.', example='{"express": [],"filter": {"filters": [{"key": "task_type","operator": "=","value": "1"}]},"groupby": [{"alias": "isp","key": "isp","sqlKey": "t.`isp`","valueKey": "isp"}],"interval": 60,"labels": [{"name": "__cms_app__","type": 0,"value": "sitemonitor"}],"statistics": [{"alias": "http_dns_time_avg","function": "avg","key": "http_dns_time"}]}'),
      SLSProcessConfig?: {
        express?: [ 
          {
            alias?: string(name='Alias', description='The alias of the extended field that indicates the result of basic operations that are performed on aggregation results.', example='SuccRate'),
            express?: string(name='Express', description='The extended field that indicates the result of basic operations that are performed on aggregation results.', example='success_count'),
          }
        ](name='Express', description='The extended fields that indicate the results of basic operations that are performed on aggregation results.'),
        filter?: {
          filters?: [ 
            {
              operator?: string(name='Operator', description='The method that is used to filter logs imported from Log Service. Valid values:

*   `contain`: contains
*   `notContain`: does not contain
*   `>`: greater than
*   `<`: less than
*   `=`: equal to
*   `! =`: not equal to
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='='),
              SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to filter logs imported from Log Service.', example='host'),
              value?: string(name='Value', description='The value of the key that is used to filter logs imported from Log Service.', example='200'),
            }
          ](name='Filters', description='The conditions that are used to filter logs imported from Log Service.'),
          relation?: string(name='Relation', description='The relationship between multiple filter conditions. Valid values:

*   and (default): Logs are processed only if all filter conditions are met.
*   or: Logs are processed if one of the filter conditions is met.', example='and'),
        }(name='Filter', description='The conditions that are used to filter logs imported from Log Service.'),
        groupBy?: [ 
          {
            alias?: string(name='Alias', description='The alias of the aggregation result.', example='ApiResult'),
            SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Log Service.', example='code'),
          }
        ](name='GroupBy', description='The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.'),
        statistics?: [ 
          {
            alias?: string(name='Alias', description='The alias of the aggregation result.', example='level_count'),
            function?: string(name='Function', description='The function that is used to aggregate log data within a statistical period. Valid values:

*   count: counts the number.
*   sum: calculates the total value.
*   avg: calculates the average value.
*   max: calculates the maximum value.
*   min: calculates the minimum value.
*   value: collects samples within the statistical period.
*   countps: calculates the average number of the specified field per second by using the following formula: Counted number of the specified field/Total number of seconds within the statistical period.
*   sumps: calculates the average number of the specified field per second by using the following formula: Total value of the specified field/Total number of seconds within the statistical period.
*   distinct: counts the number of logs where the specified field appears within the statistical period.
*   distribution: counts the number of logs that meet a specified condition within the statistical period.
*   percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.', example='count'),
            parameter1?: string(name='Parameter1', description='The value of the function that is used to aggregate logs imported from Log Service.

*   If the `Function` parameter is set to `distribution`, this parameter indicates the lower limit of the statistical interval. For example, 200 indicates that the number of HTTP requests whose status code is 2XX is calculated.
*   If the `Function` parameter is set to `percentile`, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.', example='200'),
            parameter2?: string(name='Parameter2', description='The value of the function that is used to aggregate logs imported from Log Service.

> This parameter is returned only if the `Function` parameter is set to `distribution`. This parameter indicates the upper limit of the statistical interval. For example, 299 indicates that the number of HTTP requests whose status code is 2XX is calculated.', example='299'),
            SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Log Service.', example='name'),
          }
        ](name='Statistics', description='The methods that are used to aggregate logs imported from Log Service.'),
      }(name='SLSProcessConfig', description='The configurations of the logs that are imported from Log Service.

> This parameter is returned only if the `TaskType` parameter is set to `aliyun_sls`.'),
      targetUserId?: string(name='TargetUserId', description='The ID of the member account.

> This parameter is displayed only when you call this operation by using a management account.', example='120886317861****'),
      taskId?: string(name='TaskId', description='The ID of the metric import task.', example='36****'),
      taskName?: string(name='TaskName', description='The name of the metric import task.', example='aliyun_task'),
      taskType?: string(name='TaskType', description='The type of the metric import task. Valid values:

*   aliyun_fc: metric import tasks for Alibaba Cloud services
*   aliyun_sls: metrics for logs imported from Log Service', example='aliyun_sls'),
      uploadRegion?: string(name='UploadRegion', description='The region where the host resides.', example='cn-hangzhou'),
      YARMConfig?: string(name='YARMConfig', description='The configuration file of the Alibaba Cloud service that you want to monitor by using Hybrid Cloud Monitoring.

*   namespace: the namespace of the Alibaba Cloud service.
*   metric_list: the metrics of the Alibaba Cloud service.', example='products:- namespace: acs_ecs_dashboard metric_info: - metric_list: - cpu_total'),
    }
  ](name='TaskList', description='The metric import tasks.'),
  total?: int32(name='Total', description='The total number of entries returned.', example='1'),
}

model DescribeHybridMonitorTaskListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHybridMonitorTaskListResponseBody(name='body'),
}

/**
 * @summary Queries metric import tasks.
 *
 * @description This topic provides an example on how to query all metric import tasks that belong to the current Alibaba Cloud account. The returned result indicates that the current account has only one metric import task. The metric import task is named `aliyun_task`.
 *
 * @param request DescribeHybridMonitorTaskListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHybridMonitorTaskListResponse
 */
async function describeHybridMonitorTaskListWithOptions(request: DescribeHybridMonitorTaskListRequest, runtime: Util.RuntimeOptions): DescribeHybridMonitorTaskListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.includeAliyunTask)) {
    query['IncludeAliyunTask'] = request.includeAliyunTask;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.targetUserId)) {
    query['TargetUserId'] = request.targetUserId;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHybridMonitorTaskList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries metric import tasks.
 *
 * @description This topic provides an example on how to query all metric import tasks that belong to the current Alibaba Cloud account. The returned result indicates that the current account has only one metric import task. The metric import task is named `aliyun_task`.
 *
 * @param request DescribeHybridMonitorTaskListRequest
 * @return DescribeHybridMonitorTaskListResponse
 */
async function describeHybridMonitorTaskList(request: DescribeHybridMonitorTaskListRequest): DescribeHybridMonitorTaskListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHybridMonitorTaskListWithOptions(request, runtime);
}

model DescribeLogMonitorAttributeRequest {
  metricName?: string(name='MetricName', description='The name of the log monitoring metric. Exact match is supported.

For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_total'),
  regionId?: string(name='RegionId'),
}

model DescribeLogMonitorAttributeResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  logMonitor?: {
    aggregates?: [ 
      {
        alias?: string(name='Alias', description='The alias of the aggregate function.', example='HostName'),
        fieldName?: string(name='FieldName', description='The name of the field in logs.', example='hostName'),
        function?: string(name='Function', description='The function that is used to aggregate the monitoring data of logs within an aggregation period. Valid values:

*   count: counts the number.
*   sum: calculates the total value.
*   avg: calculates the average value.
*   max: selects the maximum value.
*   min: selects the minimum value.
*   countps: calculates the counted number of the specified field divided by the total number of seconds of the aggregation period.
*   sumps: calculates the total value of the specified field divided by the total number of seconds of the aggregation period.
*   distinct: counts the number of logs where the specified field appears within the aggregation period.', example='count'),
        max?: string(name='Max', description='The maximum value.', example='10'),
        min?: string(name='Min', description='The minimum value.', example='0'),
      }
    ](name='Aggregates', description='The aggregate functions.'),
    gmtCreate?: long(name='GmtCreate', description='The time when the log monitoring metric was created.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1547431398000'),
    groupId?: long(name='GroupId', description='The ID of the application group.', example='12345'),
    groupbys?: [ string ](name='Groupbys', description='The dimension based on which the data is grouped. This parameter is equivalent to the GROUP BY clause in SQL statements. If no dimension is specified, all data is aggregated based on the aggregate function.'),
    logId?: long(name='LogId', description='The ID returned by Log Service.', example='1234'),
    metricExpress?: string(name='MetricExpress', description='The extended field. The extended field allows you to perform basic operations on the aggregation results.

Assume that you have calculated TotalNumber and 5XXNumber by aggregating the data. TotalNumber indicates the total number of HTTP requests, and 5XXNumber indicates the number of HTTP requests whose status code is greater than 499. You can calculate the server error rate by adding the following formula to the extended field: 5XXNumber/TotalNumber\\\\*100.', example='{"extend":{"errorPercent":"5XXNumber/TotalNumber*100"}}'),
    metricName?: string(name='MetricName', description='The name of the log monitoring metric. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
    slsLogstore?: string(name='SlsLogstore', description='The name of the Log Service Logstore.', example='test-logstore'),
    slsProject?: string(name='SlsProject', description='The name of the Log Service project.', example='test-project'),
    slsRegionId?: string(name='SlsRegionId', description='The ID of the region where the Log Service Logstore resides.', example='cn-hangzhou'),
    tumblingwindows?: [ string ](name='Tumblingwindows', description='The size of the tumbling window for calculation. Unit: seconds. The system performs an aggregation for each tumbling window.'),
    valueFilter?: [ 
      {
        key?: string(name='Key', description='The name of the log field used for matching in the filter condition.', example='hostName'),
        operator?: string(name='Operator', description='The method that is used to match the field value. Valid values:

*   `contain`
*   `notContain`
*   `>`: greater than
*   `<`: less than
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='contain'),
        value?: string(name='Value', description='The field value to be matched in the filter condition.', example='portal'),
      }
    ](name='ValueFilter', description='The condition that is used to filter logs. The ValueFilter and ValueFilterRelation parameters are used in pair. The filter condition is equivalent to the WHERE clause in SQL statements.

If no filter condition is specified, all logs are processed. Assume that logs contain the Level field, which may be set to Error. If you need to calculate the number of times that logs of the Error level appear every minute, you can set the filter condition to Level=Error and count the number of logs that meet this condition.'),
    valueFilterRelation?: string(name='ValueFilterRelation', description='The logical operator that is used between log filter conditions. The ValueFilter and ValueFilterRelation parameters are used in pair. Valid values:

*   and
*   or', example='and'),
  }(name='LogMonitor', description='The details of the log monitoring metric.'),
  message?: string(name='Message', description='The returned message. If the call was successful, the value success is returned. If the call failed, an error message is returned.', example='successful'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C6718537-E673-4A58-8EE1-24B8B38C7AAE'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeLogMonitorAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogMonitorAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a log monitoring metric.
 *
 * @param request DescribeLogMonitorAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogMonitorAttributeResponse
 */
async function describeLogMonitorAttributeWithOptions(request: DescribeLogMonitorAttributeRequest, runtime: Util.RuntimeOptions): DescribeLogMonitorAttributeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogMonitorAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a log monitoring metric.
 *
 * @param request DescribeLogMonitorAttributeRequest
 * @return DescribeLogMonitorAttributeResponse
 */
async function describeLogMonitorAttribute(request: DescribeLogMonitorAttributeRequest): DescribeLogMonitorAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogMonitorAttributeWithOptions(request, runtime);
}

model DescribeLogMonitorListRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.', example='123456'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Default value: 10', example='10'),
  regionId?: string(name='RegionId'),
  searchValue?: string(name='SearchValue', description='The keyword that is used to search for log monitoring metrics. Fuzzy match is supported.', example='test'),
}

model DescribeLogMonitorListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  logMonitorList?: [ 
    {
      gmtCreate?: long(name='GmtCreate', description='The time when the log monitoring metric was created.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.', example='1577766395000'),
      groupId?: long(name='GroupId', description='The ID of the application group.', example='12345'),
      logId?: long(name='LogId', description='The ID returned by Log Service.', example='12345'),
      metricName?: string(name='MetricName', description='The name of the log monitoring metric. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
      slsLogstore?: string(name='SlsLogstore', description='The name of the Log Service Logstore.', example='testSlS****'),
      slsProject?: string(name='SlsProject', description='The name of the Log Service project.', example='sls-project-test****'),
      slsRegionId?: string(name='SlsRegionId', description='The ID of the region where the Log Service Logstore resides.', example='cn-hangzhou'),
      valueFilter?: [ 
        {
          key?: string(name='Key', description='The name of the log field used for matching in the filter condition.', example='hostName'),
          operator?: string(name='Operator', description='The method that is used to match the field value. Valid values:

*   contain
*   notContain
*   `>`: greater than
*   `<`: less than
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='contain'),
          value?: string(name='Value', description='The field value to be matched in the filter condition.', example='portal'),
        }
      ](name='ValueFilter', description='The condition that is used to filter logs. The ValueFilter and ValueFilterRelation parameters are used in pair. The filter condition is equivalent to the WHERE clause in SQL statements.

If no filter condition is specified, all logs are processed. Assume that logs contain the Level field, which may be set to Error. If you need to calculate the number of times that logs of the Error level appear every minute, you can set the filter condition to Level=Error and count the number of logs that meet this condition.'),
      valueFilterRelation?: string(name='ValueFilterRelation', description='The logical operator that is used between log filter conditions. The ValueFilter and ValueFilterRelation parameters are used in pair. Valid values:

*   and
*   or', example='and'),
    }
  ](name='LogMonitorList', description='The log monitoring metrics.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned on each page.', example='10'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='01E90080-4300-4FAA-B9AE-161956BC350D'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  total?: long(name='Total', description='The total number of the returned entries.', example='15'),
}

model DescribeLogMonitorListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeLogMonitorListResponseBody(name='body'),
}

/**
 * @summary Queries log monitoring metrics.
 *
 * @param request DescribeLogMonitorListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeLogMonitorListResponse
 */
async function describeLogMonitorListWithOptions(request: DescribeLogMonitorListRequest, runtime: Util.RuntimeOptions): DescribeLogMonitorListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.searchValue)) {
    query['SearchValue'] = request.searchValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeLogMonitorList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries log monitoring metrics.
 *
 * @param request DescribeLogMonitorListRequest
 * @return DescribeLogMonitorListResponse
 */
async function describeLogMonitorList(request: DescribeLogMonitorListRequest): DescribeLogMonitorListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeLogMonitorListWithOptions(request, runtime);
}

model DescribeMetricDataRequest {
  dimensions?: string(name='Dimensions', description='The dimensions based on which the resources are queried.

Set the value to a collection of key-value pairs. A typical key-value pair is `instanceId:i-2ze2d6j5uhg20x47****`.

>  You can query a maximum of 50 instances in a single request.', example='[{"instanceId": "i-abcdefgh12****"}]'),
  endTime?: string(name='EndTime', description='The end of the time range to query monitoring data.

*   If the `StartTime` and `EndTime` parameters are not specified, the monitoring data of the last statistical period is queried.``

*   If the `StartTime` and `EndTime` parameters are specified, the monitoring data of the last statistical period in the specified time range is queried.```` The following examples demonstrate how to determine the period in which monitoring data is queried:

    *   If you set the `Period` parameter to 15, the specified time range must be less than or equal to 20 minutes. For example, if you set the StartTime parameter to 2021-05-08 08:10:00 and the EndTime parameter to 2021-05-08 08:30:00, the monitoring data of the last 15 seconds in the time range is queried.
    *   If you set the `Period` to 60 or 900, the specified time range must be less than or equal to 2 hours. For example, if you set the Period parameter to 60, the StartTime parameter to 2021-05-08 08:00:00, and the EndTime parameter to 2021-05-08 10:00:00, the monitoring data of the last 60 seconds in the time range is queried.
    *   If you set the `Period` parameter to 3600, the specified time range must be less than or equal to 2 days. For example, if you set the StartTime parameter to 2021-05-08 08:00:00 and the EndTime parameter to 2021-05-10 08:00:00, the monitoring data of the last 3,600 seconds in the time range is queried.

The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 UTC on Thursday, January 1, 1970.
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format.

>  We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='1618368960000'),
  express?: string(name='Express', description='The expression that is used to compute the query results in real time.

>  Only the `groupby` expression is supported. This expression is similar to the `GROUP BY` statement that is used in databases.', example='{"groupby":["userId","instanceId"]}'),
  length?: string(name='Length', description='The number of entries per page.

Default value: 1000.

>  The maximum value of the Length parameter in a request is 1440.', example='1000'),
  metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.

For more information about the metrics of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  period?: string(name='Period', description='The statistical period of the metric.

Valid values: 15, 60, 900, and 3600.

Unit: seconds.

> 

*   If this parameter is not specified, monitoring data is queried based on the period in which metric values are reported.

*   For more information about the statistical period of a metric that is specified by the `MetricName` parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The start of the time range to query monitoring data.

*   If the `StartTime` and `EndTime` parameters are not specified, the monitoring data of the last statistical period is queried.``

*   If the `StartTime` and `EndTime` parameters are specified, the monitoring data of the last statistical period in the specified time range is queried.```` The following examples demonstrate how to determine the period in which monitoring data is queried:

    *   If you set the `Period` parameter to 15, the specified time range must be less than or equal to 20 minutes. For example, if you set the StartTime parameter to 2021-05-08 08:10:00 and the EndTime parameter to 2021-05-08 08:30:00, the monitoring data of the last 15 seconds in the time range is queried.
    *   If you set the `Period` to 60 or 900, the specified time range must be less than or equal to 2 hours. For example, if you set the Period parameter to 60, the StartTime parameter to 2021-05-08 08:00:00, and the EndTime parameter to 2021-05-08 10:00:00, the monitoring data of the last 60 seconds in the time range is queried.
    *   If you set the `Period` parameter to 3600, the specified time range must be less than or equal to 2 days. For example, if you set the StartTime parameter to 2021-05-08 08:00:00 and the EndTime parameter to 2021-05-10 08:00:00, the monitoring data of the last 3,600 seconds in the time range is queried.

The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 UTC on Thursday, January 1, 1970.
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format.

> 

*   You must set the `StartTime` parameter to a point in time that is later than 00:00:00 UTC on Thursday, January 1, 1970. Otherwise, this parameter is invalid.

*   We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='1618368900000'),
}

model DescribeMetricDataResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  datapoints?: string(name='Datapoints', description='The monitoring data. The value includes the following fields:

*   `timestamp`: the time when the alert was triggered.
*   `userId`: the ID of the user for which the alert was triggered.
*   `instanceId`: the ID of the instance for which the alert was triggered.
*   `Minimum`, `Average`, and `Maximum`: the aggregation methods.', example='[{\\\\"timestamp\\\\":1618368900000,\\\\"Average\\\\":95.8291666666667,\\\\"Minimum\\\\":65.48,\\\\"Maximum\\\\":100.0},{\\\\"timestamp\\\\":1618368960000,\\\\"Average\\\\":95.8683333333333,\\\\"Minimum\\\\":67.84,\\\\"Maximum\\\\":100.0}]'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  period?: string(name='Period', description='The statistical period of the monitoring data.

Valid values: 15, 60, 900, and 3600.

Unit: seconds.', example='60'),
  requestId?: string(name='RequestId', description='The request ID.', example='6A5F022D-AC7C-460E-94AE-B9E75083D027'),
}

model DescribeMetricDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricDataResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data of a metric for a specified cloud service.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 10 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * ### [](#)Description
 * >  Different from [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html), the DescribeMetricData operation provides statistical features. You can set the Dimension parameter to `{"instanceId": "i-abcdefgh12****"}` to aggregate all data of your Alibaba Cloud account.
 * This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`.
 *
 * @param request DescribeMetricDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricDataResponse
 */
async function describeMetricDataWithOptions(request: DescribeMetricDataRequest, runtime: Util.RuntimeOptions): DescribeMetricDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.express)) {
    query['Express'] = request.express;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricData',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring data of a metric for a specified cloud service.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 10 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * ### [](#)Description
 * >  Different from [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html), the DescribeMetricData operation provides statistical features. You can set the Dimension parameter to `{"instanceId": "i-abcdefgh12****"}` to aggregate all data of your Alibaba Cloud account.
 * This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`.
 *
 * @param request DescribeMetricDataRequest
 * @return DescribeMetricDataResponse
 */
async function describeMetricData(request: DescribeMetricDataRequest): DescribeMetricDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricDataWithOptions(request, runtime);
}

model DescribeMetricLastRequest {
  dimensions?: string(name='Dimensions', description='The monitoring dimensions of the specified resource.

Set the value to a collection of `key:value` pairs. Example: `{"userId":"120886317861****"}` or `{"instanceId":"i-2ze2d6j5uhg20x47****"}`.

>  You can query a maximum of 50 instances in each request.', example='[{"instanceId":"i-abcdefgh12****"}]'),
  endTime?: string(name='EndTime', description='The end of the time range to query monitoring data.

*   For second-level data, the start time is obtained by comparing the time that is specified by the StartTime parameter and 20 minutes earlier of the time that is specified by the EndTime parameter. The earlier one of the compared points in time is used as the start time.
*   For minute-level data, the start time is obtained by comparing the time that is specified by the StartTime parameter and 2 hours earlier of the time that is specified by the EndTime parameter. The earlier one of the compared points in time is used as the start time.
*   For hour-level data, the start time is obtained by comparing the time that is specified by the StartTime parameter and two days earlier of the time that is specified by the EndTime parameter. The earlier one of the compared points in time is used as the start time.', example='2019-01-31 10:10:00'),
  express?: string(name='Express', description='The expression that is used to calculate the query results in real time.', example='{"groupby":["userId","instanceId"]}'),
  length?: string(name='Length', description='The number of entries per page.

Default value: 1000. This value indicates that a maximum of 1,000 entries of monitoring data can be returned on each page.

>  The maximum value of the Length parameter for each request is 1440.', example='1000'),
  metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.

For more information about metric names, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='CPUUtilization'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  nextToken?: string(name='NextToken', description='The pagination token.

*   If the number of results exceeds the maximum number of entries allowed on a single page, a pagination token is returned.
*   This token can be used as an input parameter to obtain the next page of results. If all results are obtained, no token is returned.', example='15761432850009dd70bb64cff1f0fff6c0b08ffff073be5fb1e785e2b020f7fed9b5e137bd810a6d6cff5ae****'),
  period?: string(name='Period', description='The statistical period of the monitoring data.

Valid values: 15, 60, 900, and 3600.

Unit: seconds.

> 

*   If this parameter is not specified, monitoring data is queried based on the period in which metric values are reported. The statistical period of metrics (`MetricName`) varies for each cloud service. The statistical period of metrics is displayed in the `MinPeriods` column on the **Metrics** page for each cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The start of the time range to query monitoring data.', example='2019-01-31 10:00:00'),
}

model DescribeMetricLastResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  datapoints?: string(name='Datapoints', description='The monitoring data.', example='[{"timestamp":1548777660000,"userId":"123456789876****","instanceId":"i-abcdefgh12****","Minimum":93.1,"Average":99.52,"Maximum":100}]'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='xxxxxx'),
  period?: string(name='Period', description='The time interval.

Unit: seconds.', example='60'),
  requestId?: string(name='RequestId', description='The request ID.', example='021472A6-25E3-4094-8D00-BA4B6A5486C3'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMetricLastResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricLastResponseBody(name='body'),
}

/**
 * @summary Queries the latest monitoring data of a metric.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 50 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * >  If `Throttling.User` or `Request was denied due to user flow control` is returned when you call an API operation, the API operation is throttled. For more information about how to handle the issue, see [How do I handle the throttling of a query API?](https://help.aliyun.com/document_detail/2615031.html)
 * ### [](#)Precautions
 * The storage duration of the monitoring data of each cloud service is related to the `Period` parameter (statistical period). A larger value of the `Period` parameter indicates that the monitoring data is distributed in a larger time range and the storage duration of the monitoring data is longer. The following list describes the specific relationships:
 * *   If the value of the `Period` parameter is less than 60 seconds, the storage duration is seven days.
 * *   If the value of the `Period` parameter is 60 seconds, the storage duration is 31 days.
 * *   If the value of the `Period` parameter is 300 seconds, the storage duration is 91 days.
 * ### [](#)Description
 * This topic provides an example on how to query the latest monitoring data of the `CPUUtilization` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The returned result indicates that the monitoring data for the instance `i-abcdefgh12****` of the account `123456789876****` is queried at an interval of 60 seconds. The maximum, minimum, and average values of the metric are 100, 93.1, and 99.52.
 *
 * @param request DescribeMetricLastRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricLastResponse
 */
async function describeMetricLastWithOptions(request: DescribeMetricLastRequest, runtime: Util.RuntimeOptions): DescribeMetricLastResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.express)) {
    query['Express'] = request.express;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricLast',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the latest monitoring data of a metric.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 50 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * >  If `Throttling.User` or `Request was denied due to user flow control` is returned when you call an API operation, the API operation is throttled. For more information about how to handle the issue, see [How do I handle the throttling of a query API?](https://help.aliyun.com/document_detail/2615031.html)
 * ### [](#)Precautions
 * The storage duration of the monitoring data of each cloud service is related to the `Period` parameter (statistical period). A larger value of the `Period` parameter indicates that the monitoring data is distributed in a larger time range and the storage duration of the monitoring data is longer. The following list describes the specific relationships:
 * *   If the value of the `Period` parameter is less than 60 seconds, the storage duration is seven days.
 * *   If the value of the `Period` parameter is 60 seconds, the storage duration is 31 days.
 * *   If the value of the `Period` parameter is 300 seconds, the storage duration is 91 days.
 * ### [](#)Description
 * This topic provides an example on how to query the latest monitoring data of the `CPUUtilization` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The returned result indicates that the monitoring data for the instance `i-abcdefgh12****` of the account `123456789876****` is queried at an interval of 60 seconds. The maximum, minimum, and average values of the metric are 100, 93.1, and 99.52.
 *
 * @param request DescribeMetricLastRequest
 * @return DescribeMetricLastResponse
 */
async function describeMetricLast(request: DescribeMetricLastRequest): DescribeMetricLastResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricLastWithOptions(request, runtime);
}

model DescribeMetricListRequest {
  dimensions?: string(name='Dimensions', description='The dimensions that specify the resources whose monitoring data you want to query.

Set the value to a collection of key-value pairs. A typical key-value pair is `instanceId:i-2ze2d6j5uhg20x47****`.

>  You can query a maximum of 50 instances in a single request.', example='[{"instanceId": "i-abcdefgh12****"}]'),
  endTime?: string(name='EndTime', description='The end of the time range to query. The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format', example='2019-01-30 00:10:00'),
  express?: string(name='Express', description='The expression that is used to compute the query results in real time.

>  Only the groupby expression is supported. This expression is similar to the GROUP BY statement that is used in databases.', example='{"groupby":["userId","instanceId"]}'),
  length?: string(name='Length', description='The number of entries to return on each page.

>  The maximum value of the Length parameter in a request is 1440.', example='1000'),
  metricName?: string(name='MetricName', description='The name of the metric.

For more information about metric names, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service. Format: acs_service name.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  nextToken?: string(name='NextToken', description='The paging token.

>  If this parameter is not specified, the data on the first page is returned. A return value other than Null of this parameter indicates that not all entries have been returned. You can use this value as an input parameter to obtain entries on the next page. The value Null indicates that all query results have been returned.', example='15761485350009dd70bb64cff1f0fff750b08ffff073be5fb1e785e2b020f1a949d5ea14aea7fed82f01dd8****'),
  period?: string(name='Period', description='The interval at which the monitoring data is queried.

Valid values: 60, 300, and 900.

Unit: seconds.

>  Configure this parameter based on your business scenario.', example='60'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format

>  The specified period includes the end time and excludes the start time. The start time must be earlier than the end time.', example='2019-01-30 00:00:00'),
}

model DescribeMetricListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  datapoints?: string(name='Datapoints', description='The monitoring data.', example='[{"timestamp":1548777660000,"userId":"120886317861****","instanceId":"i-abc","Minimum":9.92,"Average":9.92,"Maximum":9.92}]'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  nextToken?: string(name='NextToken', description='The paging token.', example='15761441850009dd70bb64cff1f0fff6d0b08ffff073be5fb1e785e2b020f7fed9b5e137bd810a6d6cff5ae****'),
  period?: string(name='Period', description='The interval at which the monitoring data is queried. Unit: seconds. Valid values: 60, 300, and 900.', example='60'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3121AE7D-4AFF-4C25-8F1D-C8226EBB1F42'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeMetricListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricListResponseBody(name='body'),
}

/**
 * @summary Queries the monitoring data of a metric for a specified cloud service.
 *
 * @description ## Limits
 * Each API operation can be called up to 50 times per second. An Alibaba Cloud account and the RAM users within the account share the quota. 
 * >This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The returned result indicates that the monitoring data for the instance `i-abcdefgh12****` of the account `120886317861****` is queried at an interval of 60 seconds. The maximum, minimum, and average values of the metric are 100, 93.1, and 99.52.
 *
 * @param request DescribeMetricListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricListResponse
 */
async function describeMetricListWithOptions(request: DescribeMetricListRequest, runtime: Util.RuntimeOptions): DescribeMetricListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.express)) {
    query['Express'] = request.express;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the monitoring data of a metric for a specified cloud service.
 *
 * @description ## Limits
 * Each API operation can be called up to 50 times per second. An Alibaba Cloud account and the RAM users within the account share the quota. 
 * >This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The returned result indicates that the monitoring data for the instance `i-abcdefgh12****` of the account `120886317861****` is queried at an interval of 60 seconds. The maximum, minimum, and average values of the metric are 100, 93.1, and 99.52.
 *
 * @param request DescribeMetricListRequest
 * @return DescribeMetricListResponse
 */
async function describeMetricList(request: DescribeMetricListRequest): DescribeMetricListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricListWithOptions(request, runtime);
}

model DescribeMetricMetaListRequest {
  labels?: string(name='Labels', description='The tags for filtering metrics. Specify a JSON string.

Format: ` [{"name":"tag key","value":"tag value"},{"name":"tag key","value":"tag value"}]  `. The following tags are available:

*   metricCategory: the category of the metric.
*   alertEnable: specifies whether to report alerts for the metric.
*   alertUnit: the unit of the metric in the alerts.
*   unitFactor: the factor for metric unit conversion.
*   minAlertPeriod: the minimum interval at which the alert is reported.
*   productCategory: the category of the service.', example='[{"name":"productCategory","value":"kvstore_old"}]'),
  metricName?: string(name='MetricName', description='The metric name. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='CPUUtilization'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_kvstore'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 30.', example='30'),
}

model DescribeMetricMetaListResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='0CCE0AF0-053C-4B13-A583-DC9A85785D49'),
  resources?: {
    resource?: [ 
    {
      description?: string(name='Description', description='The metric description.', example='CPUUtilization'),
      dimensions?: string(name='Dimensions', description='The monitoring dimensions of the resource. Multiple monitoring dimensions are separated with commas (,).', example='instanceId'),
      labels?: string(name='Labels', description='The tags of the metric, including one or more JSON strings.

Format: `[{"name":"tag key","value":"tag value"}]`. The `name` can be repeated. The following tags are available:

*   metricCategory: the category of the metric.
*   alertEnable: indicates whether to report alerts for the metric.
*   alertUnit: the unit of the metric in the alerts.
*   unitFactor: the factor for metric unit conversion.
*   minAlertPeriod: the minimum interval at which the alert is reported.
*   productCategory: the category of the service.', example='[{\\\\"name\\\\":\\\\"alertUnit\\\\",\\\\"value\\\\":\\\\"Bytes\\\\"},{\\\\"name\\\\":\\\\"minAlertPeriod\\\\",\\\\"value\\\\":\\\\"60\\\\"},{\\\\"name\\\\":\\\\"metricCategory\\\\",\\\\"value\\\\":\\\\"instanceId\\\\"},{\\\\"name\\\\":\\\\"instanceType\\\\",\\\\"value\\\\":\\\\"disaster\\\\"},{\\\\"name\\\\":\\\\"is_alarm\\\\",\\\\"value\\\\":\\\\"true\\\\"},{\\\\"name\\\\":\\\\"productCategory\\\\",\\\\"value\\\\":\\\\"kvstore_old\\\\"}]'),
      metricName?: string(name='MetricName', description='The metric name.', example='CPUUtilization'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_kvstore'),
      periods?: string(name='Periods', description='The statistical periods of the metric. Multiple statistical periods are separated with commas (,).

Unit: seconds.', example='60,300'),
      statistics?: string(name='Statistics', description='The statistical method. Multiple statistical methods are separated with commas (,).', example='Average,Minimum,Maximum'),
      unit?: string(name='Unit', description='The unit of the metric.', example='%'),
    }
  ](name='Resource')
  }(name='Resources', description='The configuration of the metrics in the resources.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: string(name='TotalCount', description='The total number of entries returned.', example='12'),
}

model DescribeMetricMetaListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricMetaListResponseBody(name='body'),
}

/**
 * @summary Queries the details of metrics that are supported in CloudMonitor.
 *
 * @description This operation is used together with DescribeMetricList and DescribeMetricLast. For more information, see [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html) and [DescribeMetricLast](https://help.aliyun.com/document_detail/51939.html).
 *
 * @param request DescribeMetricMetaListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricMetaListResponse
 */
async function describeMetricMetaListWithOptions(request: DescribeMetricMetaListRequest, runtime: Util.RuntimeOptions): DescribeMetricMetaListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricMetaList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of metrics that are supported in CloudMonitor.
 *
 * @description This operation is used together with DescribeMetricList and DescribeMetricLast. For more information, see [DescribeMetricList](https://help.aliyun.com/document_detail/51936.html) and [DescribeMetricLast](https://help.aliyun.com/document_detail/51939.html).
 *
 * @param request DescribeMetricMetaListRequest
 * @return DescribeMetricMetaListResponse
 */
async function describeMetricMetaList(request: DescribeMetricMetaListRequest): DescribeMetricMetaListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricMetaListWithOptions(request, runtime);
}

model DescribeMetricRuleBlackListRequest {
  category?: string(name='Category', description='The ID of the blacklist policy.', example='ecs'),
  ids?: [ string ](name='Ids'),
  instanceIds?: [ string ](name='InstanceIds', description='The IDs of the instances in the blacklist policy.

Valid values of N: 0 to 10.'),
  isEnable?: boolean(name='IsEnable', description='The status of the blacklist policy. Valid values:

*   true: The blacklist policy is enabled.
*   false: The blacklist policy is disabled.', example='true'),
  name?: string(name='Name', description='The name of the blacklist policy.

This parameter supports fuzzy match.', example='Blacklist-01'),
  namespace?: string(name='Namespace', description='The timestamp when the blacklist policy expired.

Unit: milliseconds.', example='acs_ecs_dashboard'),
  order?: int32(name='Order', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='DESC'),
  pageNumber?: int32(name='PageNumber', description='The name of the metric.', example='1'),
  pageSize?: int32(name='PageSize', description='The categories of the Alibaba Cloud service. For example, ApsaraDB for Redis includes the following categories: ApsaraDB for Redis (standard architecture), ApsaraDB for Redis (cluster architecture), and ApsaraDB for Redis (read/write splitting architecture). In this case, the valid values of this parameter for ApsaraDB for Redis include `kvstore_standard`, `kvstore_sharding`, and `kvstore_splitrw`.', example='100'),
  regionId?: string(name='RegionId'),
  scopeType?: string(name='ScopeType', description='The effective scope of the blacklist policy. Valid values:

*   USER: The blacklist policy takes effect only within the current Alibaba Cloud account.
*   GROUP: The blacklist policy takes effect only within the specified application group.', example='USER'),
}

model DescribeMetricRuleBlackListResponseBody = {
  code?: string(name='Code', description='The categories of the Alibaba Cloud service. For example, ApsaraDB for Redis includes the following categories: ApsaraDB for Redis (standard architecture), ApsaraDB for Redis (cluster architecture), and ApsaraDB for Redis (read/write splitting architecture). In this case, the valid values of this parameter for ApsaraDB for Redis include `kvstore_standard`, `kvstore_sharding`, and `kvstore_splitrw`.', example='200'),
  describeMetricRuleBlackList?: [ 
    {
      category?: string(name='Category', description='The category of the cloud service. For example, ApsaraDB for Redis includes the following categories: ApsaraDB for Redis (standard architecture), ApsaraDB for Redis (cluster architecture), and ApsaraDB for Redis (read/write splitting architecture). In this case, the valid values of this parameter for ApsaraDB for Redis include `kvstore_standard`, `kvstore_sharding`, and `kvstore_splitrw`.', example='ecs'),
      createTime?: string(name='CreateTime', description='The timestamp when the blacklist policy was created.

Unit: milliseconds.', example='1665714561000'),
      effectiveTime?: string(name='EffectiveTime', description='The time range within which the blacklist policy is effective.', example='00:00-23:59'),
      enableEndTime?: long(name='EnableEndTime', description='The timestamp when the blacklist policy started to take effect.

Unit: milliseconds.', example='1640608200000'),
      enableStartTime?: long(name='EnableStartTime', description='The timestamp when the blacklist policy expired.

Unit: milliseconds.', example='1640237400000'),
      id?: string(name='Id', description='The ID of the blacklist policy.', example='93514c96-ceb8-47d8-8ee3-93b6d98b****'),
      instances?: [ string ](name='Instances', description='The IDs of the instances that belong to the specified cloud service.'),
      isEnable?: boolean(name='IsEnable', description='The status of the blacklist policy. Valid values:

*   true: The blacklist policy is enabled.
*   false: The blacklist policy is disabled.', example='true'),
      metrics?: [ 
        {
          metricName?: string(name='MetricName', description='The metric name.', example='disk_utilization'),
          resource?: string(name='Resource', description='The extended dimension of the instance. For example, `{"device":"C:"}` specifies that the blacklist policy is applied to all C disks of the specified Elastic Compute Service (ECS) instance.', example='[{"device":"C:"}]'),
        }
      ](name='Metrics', description='The metrics of the instance.'),
      name?: string(name='Name', description='The name of the blacklist policy.', example='Blacklist-01'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_ecs_dashboard'),
      scopeType?: string(name='ScopeType', description='The effective scope of the blacklist policy. Valid values:

*   USER: The blacklist policy takes effect only within the current Alibaba Cloud account.
*   GROUP: The blacklist policy takes effect only within the specified application group.', example='USER'),
      scopeValue?: [ string ](name='ScopeValue', description='The IDs of the application groups.'),
      updateTime?: string(name='UpdateTime', description='The timestamp when the blacklist policy was modified.

Unit: milliseconds.', example='1665718373000'),
    }
  ](name='DescribeMetricRuleBlackList', description='The queried blacklist policies.'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The namespace of the cloud service.', example='D63E76CB-29AA-5B9F-88CE-400A6F28D428'),
  success?: boolean(name='Success', description='The namespace of the cloud service.

For more information about the namespaces of different cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='true'),
  total?: int32(name='Total', description='The timestamp when the blacklist policy was created.

Unit: milliseconds.', example='1'),
}

model DescribeMetricRuleBlackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleBlackListResponseBody(name='body'),
}

/**
 * @param request DescribeMetricRuleBlackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleBlackListResponse
 */
async function describeMetricRuleBlackListWithOptions(request: DescribeMetricRuleBlackListRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.ids)) {
    query['Ids'] = request.ids;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.isEnable)) {
    query['IsEnable'] = request.isEnable;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.scopeType)) {
    query['ScopeType'] = request.scopeType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleBlackList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeMetricRuleBlackListRequest
 * @return DescribeMetricRuleBlackListResponse
 */
async function describeMetricRuleBlackList(request: DescribeMetricRuleBlackListRequest): DescribeMetricRuleBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleBlackListWithOptions(request, runtime);
}

model DescribeMetricRuleCountRequest {
  metricName?: string(name='MetricName', description='The metric name. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  regionId?: string(name='RegionId'),
}

model DescribeMetricRuleCountResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  metricRuleCount?: {
    alarm?: int32(name='Alarm', description='The number of alert rules with active alerts.', example='5'),
    disable?: int32(name='Disable', description='The number of disabled alert rules.', example='0'),
    nodata?: int32(name='Nodata', description='The number of alert rules without data.', example='0'),
    ok?: int32(name='Ok', description='The number of alert rules without active alerts.', example='40'),
    total?: int32(name='Total', description='The total number of alert rules.', example='45'),
  }(name='MetricRuleCount', description='The number of alert rules in each state.'),
  requestId?: string(name='RequestId', description='The request ID.', example='FF38D33A-67C1-40EB-AB65-FAEE51EDB644'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMetricRuleCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of alert rules in each state.
 *
 * @param request DescribeMetricRuleCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleCountResponse
 */
async function describeMetricRuleCountWithOptions(request: DescribeMetricRuleCountRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleCountResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleCount',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of alert rules in each state.
 *
 * @param request DescribeMetricRuleCountRequest
 * @return DescribeMetricRuleCountResponse
 */
async function describeMetricRuleCount(request: DescribeMetricRuleCountRequest): DescribeMetricRuleCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleCountWithOptions(request, runtime);
}

model DescribeMetricRuleListRequest {
  alertState?: string(name='AlertState', description='The status of the alert rule. Valid values:

*   OK: The alert rule has no active alerts.
*   ALARM: The alert rule has active alerts.
*   INSUFFICIENT_DATA: No data is available.', example='OK'),
  dimensions?: string(name='Dimensions', description='The monitoring dimensions of the specified resource.

Set the value to a collection of `key:value` pairs. Example: `{"userId":"120886317861****"}` or `{"instanceId":"i-2ze2d6j5uhg20x47****"}`.', example='{"instanceId":"i-2ze2d6j5uhg20x47****"}'),
  enableState?: boolean(name='EnableState', description='Specifies whether to query enabled or disabled alert rules. Valid values:

*   true: queries enabled alert rules.
*   false: queries disabled alert rules.', example='true'),
  groupId?: string(name='GroupId', description='The ID of the application group.

For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='7301****'),
  metricName?: string(name='MetricName', description='The name of the metric.

For information about how to obtain the name of a metric, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For information about how to obtain the namespace of a cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  page?: int32(name='Page', description='The page number of the page to return.

Minimum value: 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Minimum value: 1. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  ruleIds?: string(name='RuleIds', description='The ID of the alert rule. You can specify up to 20 IDs at a time. Separate multiple IDs with commas (,).', example='applyTemplate344cfd42-0f32-4fd6-805a-88d7908a****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

This parameter supports fuzzy match.', example='Rule_01'),
}

model DescribeMetricRuleListResponseBody = {
  alarms?: {
    alarm?: [ 
    {
      alertState?: string(name='AlertState', description='The status of the alert rule. Valid values:

*   OK: The alert rule has no active alerts.
*   ALARM: The alert rule has active alerts.
*   INSUFFICIENT_DATA: No data is available.', example='OK'),
      compositeExpression?: {
        expressionList?: {
          expressionList?: [ 
          {
            comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
            metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.', example='cpu_total'),
            period?: int32(name='Period', description='The aggregation period of the metric.

Unit: seconds.', example='60'),
            statistics?: string(name='Statistics', description='The statistical method of the metric. Valid values:

*   $Maximum: the maximum value
*   $Minimum: the minimum value
*   $Average: the average value
*   $Availability: the availability rate (usually used for site monitoring)

>  `$` is the prefix of the metric. For information about the Alibaba Cloud services that are supported by CloudMonitor, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='$Maximum'),
            threshold?: string(name='Threshold', description='The alert threshold.', example='90'),
          }
        ](name='ExpressionList')
        }(name='ExpressionList', description='The trigger conditions that are created in standard mode.'),
        expressionListJoin?: string(name='ExpressionListJoin', description='The relationship between the trigger conditions for multiple metrics. Valid values:

*   `&&`: An alert is triggered only if all metrics meet the trigger conditions. An alert is triggered only if the results of all expressions specified in the ExpressionList parameter are `true`.
*   `||`: An alert is triggered if one of the metrics meets the trigger conditions.', example='||'),
        expressionRaw?: string(name='ExpressionRaw', description='The trigger conditions that are created by using expressions. You can use expressions to create trigger conditions in the following scenarios:

*   Set an alert blacklist for specific resources. For example, if you specify `$instanceId != \\\\"i-io8kfvcpp7x5****\\\\" ``&&`` $Average > 50`, no alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 50.
*   Set a special alert threshold for a specified instance in the rule. For example, if you specify `$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)`, an alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 80 or the `average metric value` of other instances exceeds 50.
*   Limit the number of instances whose metric values exceed the threshold. For example, if you specify `count($Average > 20) > 3`, an alert is triggered only when the number of instances whose `average metric value` exceeds 20 exceeds three.', example='$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)'),
        level?: string(name='Level', description='The alert level. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='Critical'),
        times?: int32(name='Times', description='The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.', example='3'),
      }(name='CompositeExpression', description='The trigger conditions for multiple metrics.

>  The trigger conditions for a single metric and multiple metrics are mutually exclusive. You cannot specify trigger conditions for a single metric and multiple metrics at the same time.'),
      contactGroups?: string(name='ContactGroups', description='The alert contact group.', example='ECS_Alarm'),
      dimensions?: string(name='Dimensions', description='The dimensions of the alert rule.', example='[{"instanceId":"i-2ze2d6j5uhg20x47****"}]'),
      effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective.', example='05:31-23:59'),
      enableState?: boolean(name='EnableState', description='Indicates whether the alert rule is enabled. Valid values:

*   true: The alert rule is enabled.
*   false: The alert rule is disabled.', example='true'),
      escalations?: {
        critical?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          preCondition?: string(name='PreCondition', description='The additional conditions for triggering Critical-level alerts. The additional conditions take effect when the value of the ComparisonOperator parameter is GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, or LessThanLastPeriod.

For example, the values of the PreCondition, ComparisonOperator, and Threshold parameters are set to $Average>80, GreaterThanYesterday, and 10, respectively. An alert is triggered only when the average metric value is greater than 80 and 10% greater than the average metric value at the same time yesterday.

>  $Average is a placeholder that consists of `a dollar sign ($) and the statistical method`. CloudMonitor replaces the placeholder with the aggregated value or original value before value comparison.', example='$Average>80'),
          statistics?: string(name='Statistics', description='The statistical methods for Critical-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.', example='90'),
          times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.', example='3'),
        }(name='Critical', description='The conditions for triggering Critical-level alerts.'),
        info?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          preCondition?: string(name='PreCondition', description='The additional conditions for triggering Info-level alerts. The additional conditions take effect when the value of the ComparisonOperator parameter is GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, or LessThanLastPeriod.

For example, the values of the PreCondition, ComparisonOperator, and Threshold parameters are set to $Average>80, GreaterThanYesterday, and 10, respectively. An alert is triggered only when the average metric value is greater than 80 and 10% greater than the average metric value at the same time yesterday.

>  $Average is a placeholder that consists of `a dollar sign ($) and the statistical method`. CloudMonitor replaces the placeholder with the aggregated value or original value before value comparison.', example='$Average>80'),
          statistics?: string(name='Statistics', description='The statistical methods for Info-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Info-level alerts.', example='90'),
          times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.', example='3'),
        }(name='Info', description='The conditions for triggering Info-level alerts.'),
        warn?: {
          comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          preCondition?: string(name='PreCondition', description='The additional conditions for triggering Warn-level alerts. The additional conditions take effect when the value of the ComparisonOperator parameter is GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, or LessThanLastPeriod.

For example, the values of the PreCondition, ComparisonOperator, and Threshold parameters are set to $Average>80, GreaterThanYesterday, and 10, respectively. An alert is triggered only when the average metric value is greater than 80 and 10% greater than the average metric value at the same time yesterday.

>  $Average is a placeholder that consists of `a dollar sign ($) and the statistical method`. CloudMonitor replaces the placeholder with the aggregated value or original value before value comparison.', example='$Average>80'),
          statistics?: string(name='Statistics', description='The statistical methods for Warn-level alerts.', example='Average'),
          threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.', example='90'),
          times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.', example='3'),
        }(name='Warn', description='The conditions for triggering Warn-level alerts.'),
      }(name='Escalations', description='The conditions for triggering different levels of alerts.'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
      groupName?: string(name='GroupName', description='The name of the application group.

>  If the alert rule is associated with an application group, the name of the application group is returned in this parameter.', example='ECS_Group'),
      labels?: {
        labels?: [ 
        {
          key?: string(name='Key', description='The tag key of the alert rule.', example='cmsRuleKey'),
          value?: string(name='Value', description='The tag value of the alert rule.', example='cmsRuleValue'),
        }
      ](name='Labels')
      }(name='Labels', description='The tags of the alert rule.'),
      mailSubject?: string(name='MailSubject', description='The subject of the alert notification email.', example='"${serviceType}-${metricName}-${levelDescription}Notification(${dimensions})"'),
      metricName?: string(name='MetricName', description='The name of the metric.', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.', example='acs_ecs_dashboard'),
      noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid values:

*   KEEP_LAST_STATE (default value): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.', example='KEEP_LAST_STATE'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective.', example='00:00-05:30'),
      period?: string(name='Period', description='The statistical period.', example='60'),
      prometheus?: {
        annotations?: {
          annotations?: [ 
          {
            key?: string(name='Key', description='The key of the annotation.', example='summary'),
            value?: string(name='Value', description='The value of the annotation.', example='{{ $labels.instance }} CPU usage above 10% {current value: {{ humanizePercentage $value }} }'),
          }
        ](name='Annotations')
        }(name='Annotations', description='The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.

>  This parameter is equivalent to the annotations parameter of open source Prometheus.'),
        level?: string(name='Level', description='The alert level. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='Critical'),
        promQL?: string(name='PromQL', description='The PromQL query statement.

>  The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.', example='CpuUsage{instanceId="xxxx"}[1m]>90'),
        times?: long(name='Times', description='The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.', example='3'),
      }(name='Prometheus', description='The Prometheus alerts.

>  This parameter is required only if you create a Prometheus alert rule for Hybrid Cloud Monitoring.'),
      resources?: string(name='Resources', description='The resources that are associated with the alert rule.', example='[{\\\\"instanceId\\\\":\\\\"i-2ze2d6j5uhg20x47****\\\\"}]'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='applyTemplate344cfd42-0f32-4fd6-805a-88d7908a****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='Rule_01'),
      silenceTime?: int32(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400. Minimum value: 3600.

Only one alert is reported during each mute period even if the metric value consecutively exceeds the alert rule threshold several times.', example='86400'),
      sourceType?: string(name='SourceType', description='The type of the alert rule. Valid value: METRIC. This value indicates an alert rule for time series metrics.', example='METRIC'),
      webhook?: string(name='Webhook', description='The callback URL. CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.', example='https://www.aliyun.com'),
    }
  ](name='Alarm')
  }(name='Alarms', description='The alert rules.'),
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='386C6712-335F-5054-930A-CC92B851ECBA'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  total?: string(name='Total', description='The total number of returned entries.', example='1'),
}

model DescribeMetricRuleListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleListResponseBody(name='body'),
}

/**
 * @summary Queries alert rules.
 *
 * @description This topic provides an example on how to query all alert rules within your Alibaba Cloud account. The returned result shows that only one alert rule is found. The name of the alert rule is `Rule_01` and the ID is `applyTemplate344cfd42-0f32-4fd6-805a-88d7908a****`.
 *
 * @param request DescribeMetricRuleListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleListResponse
 */
async function describeMetricRuleListWithOptions(request: DescribeMetricRuleListRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertState)) {
    query['AlertState'] = request.alertState;
  }
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.enableState)) {
    query['EnableState'] = request.enableState;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.ruleIds)) {
    query['RuleIds'] = request.ruleIds;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries alert rules.
 *
 * @description This topic provides an example on how to query all alert rules within your Alibaba Cloud account. The returned result shows that only one alert rule is found. The name of the alert rule is `Rule_01` and the ID is `applyTemplate344cfd42-0f32-4fd6-805a-88d7908a****`.
 *
 * @param request DescribeMetricRuleListRequest
 * @return DescribeMetricRuleListResponse
 */
async function describeMetricRuleList(request: DescribeMetricRuleListRequest): DescribeMetricRuleListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleListWithOptions(request, runtime);
}

model DescribeMetricRuleTargetsRequest {
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

This parameter is required.', example='ae06917_75a8c43178ab66****'),
}

model DescribeMetricRuleTargetsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='786E92D2-AC66-4250-B76F-F1E2FCDDBA1C'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  targets?: {
    target?: [ 
    {
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource. Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. Fields:

*   {Service name abbreviation}: the abbreviation of the service name. Valid value: mns.
*   {userId}: the ID of the Alibaba Cloud account.
*   {regionId}: the region ID of the message queue or topic.
*   {Resource type}`: the type of the resource for which alerts are triggered. Valid values: - **queues** - **topics** {Resource name}: the name of the resource. - If the resource type is set to **queues**, the resource name is the name of the message queue. - If the resource type is set to **topics**, the resource name is the name of the topic.`', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
      id?: string(name='Id', description='The ID of the resource for which alerts are triggered.', example='1'),
      jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
      level?: string(name='Level', description='The level of the alert. Valid values:

*   INFO: information
*   WARN: warning
*   CRITICAL: critical', example='["INFO", "WARN", "CRITICAL"]'),
    }
  ](name='Target')
  }(name='Targets', description='The information about the resource for which alerts are triggered.'),
}

model DescribeMetricRuleTargetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleTargetsResponseBody(name='body'),
}

/**
 * @summary Queries the resources that are associated with a specified alert rule.
 *
 * @description ## Limit
 * This operation supports only Message Service (MNS) resources. 
 * >This topic provides an example on how to query the resources that are associated with an alert rule whose ID is `ae06917_75a8c43178ab66****`.
 *
 * @param request DescribeMetricRuleTargetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleTargetsResponse
 */
async function describeMetricRuleTargetsWithOptions(request: DescribeMetricRuleTargetsRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleTargetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleTargets',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resources that are associated with a specified alert rule.
 *
 * @description ## Limit
 * This operation supports only Message Service (MNS) resources. 
 * >This topic provides an example on how to query the resources that are associated with an alert rule whose ID is `ae06917_75a8c43178ab66****`.
 *
 * @param request DescribeMetricRuleTargetsRequest
 * @return DescribeMetricRuleTargetsResponse
 */
async function describeMetricRuleTargets(request: DescribeMetricRuleTargetsRequest): DescribeMetricRuleTargetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleTargetsWithOptions(request, runtime);
}

model DescribeMetricRuleTemplateAttributeRequest {
  name?: string(name='Name', description='The name of the alert template. You must specify at least one of the `Name` and `TemplateId` parameters.

For information about how to obtain the name of an alert template, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).', example='ECS_Template1'),
  regionId?: string(name='RegionId'),
  templateId?: string(name='TemplateId', description='The ID of the alert template. You must specify at least one of the `Name` and `TemplateId` parameters.

For information about how to obtain the ID of an alert template, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).', example='70****'),
}

model DescribeMetricRuleTemplateAttributeResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message returned.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='8F3A82AD-DA92-52B0-8EC6-C059D1C3839F'),
  resource?: {
    alertTemplates?: {
      alertTemplate?: [ 
      {
        category?: string(name='Category', description='The abbreviation of the Alibaba Cloud service name.', example='ecs'),
        escalations?: {
          critical?: {
            comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
            statistics?: string(name='Statistics', description='The statistical method for Critical-level alerts.

The value of the `Statistics` parameter varies with the cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
            threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.', example='90'),
            times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.', example='5'),
          }(name='Critical', description='The conditions for triggering Critical-level alerts.'),
          info?: {
            comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold for Info-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
            statistics?: string(name='Statistics', description='The statistical method for Info-level alerts.

The value of the `Statistics` parameter varies with the cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
            threshold?: string(name='Threshold', description='The threshold for Info-level alerts.', example='90'),
            times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.', example='3'),
          }(name='Info', description='The conditions for triggering Info-level alerts.'),
          warn?: {
            comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
            statistics?: string(name='Statistics', description='The statistical method for Warn-level alerts.

The value of the `Statistics` parameter varies with the cloud service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
            threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.', example='90'),
            times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.', example='3'),
          }(name='Warn', description='The conditions for triggering Warn-level alerts.'),
        }(name='Escalations', description='The threshold and the alert level.'),
        labels?: {
          labels?: [ 
          {
            key?: string(name='Key', description='The tag key of the alert template.', example='label1'),
            value?: string(name='Value', description='The tag value of the alert template.', example='value1'),
          }
        ](name='Labels')
        }(name='Labels', description='The tags of the alert template.'),
        metricName?: string(name='MetricName', description='The metric name.', example='cpu_total'),
        namespace?: string(name='Namespace', description='The namespace of the Alibaba Cloud service.', example='acs_ecs_dashboard'),
        noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid values:

*   KEEP_LAST_STATE (default): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.', example='KEEP_LAST_STATE'),
        ruleName?: string(name='RuleName', description='The name of the alert rule.', example='ECS_Rule'),
        selector?: string(name='Selector', description='The dimension of the alert. It is an extended field.', example='{"disk":"/"}'),
        webhook?: string(name='Webhook', description='The callback URL to which a request is sent when an alert is triggered.', example='https://www.aliyun.com'),
      }
    ](name='AlertTemplate')
    }(name='AlertTemplates', description='The queried alert templates.'),
    description?: string(name='Description', description='The description of the alert template.'),
    name?: string(name='Name', description='The name of the alert template.', example='ECS_Template1'),
    restVersion?: string(name='RestVersion', description='The version of the alert template.', example='1'),
    templateId?: string(name='TemplateId', description='The ID of the alert template.', example='70****'),
  }(name='Resource', description='The details of the alert template.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMetricRuleTemplateAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleTemplateAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of an alert template.
 *
 * @description This topic provides an example on how to query the details of an alert template whose ID is `70****`.
 *
 * @param request DescribeMetricRuleTemplateAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleTemplateAttributeResponse
 */
async function describeMetricRuleTemplateAttributeWithOptions(request: DescribeMetricRuleTemplateAttributeRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleTemplateAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleTemplateAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of an alert template.
 *
 * @description This topic provides an example on how to query the details of an alert template whose ID is `70****`.
 *
 * @param request DescribeMetricRuleTemplateAttributeRequest
 * @return DescribeMetricRuleTemplateAttributeResponse
 */
async function describeMetricRuleTemplateAttribute(request: DescribeMetricRuleTemplateAttributeRequest): DescribeMetricRuleTemplateAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleTemplateAttributeWithOptions(request, runtime);
}

model DescribeMetricRuleTemplateListRequest {
  history?: boolean(name='History', description='Specifies whether to display the history of applying the alert templates to application groups. Valid values:

*   true
*   false (default)', example='false'),
  keyword?: string(name='Keyword', description='The keyword of the alert template name.', example='ECS'),
  name?: string(name='Name', description='The name of the alert template.', example='ECS_Template1'),
  order?: boolean(name='Order', description='The sorting order. Valid values:

*   true (default): ascending order
*   false: descending order', example='true'),
  orderBy?: string(name='OrderBy', description='The sorting basis. Valid values:

*   gmtMotified: sorts alert templates by modification time
*   gmtCreate (default): sorts alert templates by creation time', example='gmtCreate'),
  pageNumber?: long(name='PageNumber', description='The page number.

Default value: 1.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page.', example='10'),
  regionId?: string(name='RegionId'),
  templateId?: long(name='TemplateId', description='The ID of the alert template.', example='70****'),
}

model DescribeMetricRuleTemplateListResponseBody = {
  code?: int32(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='659401C0-6214-5C02-972A-CFA929D717B7'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  templates?: {
    template?: [ 
    {
      applyHistories?: {
        applyHistory?: [ 
        {
          applyTime?: long(name='ApplyTime', description='The timestamp when the alert template was applied to the application group.

Unit: milliseconds.', example='1646055898000'),
          groupId?: long(name='GroupId', description='The ID of the application group.', example='3607****'),
          groupName?: string(name='GroupName', description='The name of the application group.', example='ECS_Group'),
        }
      ](name='ApplyHistory')
      }(name='ApplyHistories', description='The history of applying the alert templates to application groups.'),
      description?: string(name='Description', description='The description of the alert template.'),
      gmtCreate?: long(name='GmtCreate', description='The timestamp when the alert template was created.

Unit: milliseconds.', example='1646018798000'),
      gmtModified?: long(name='GmtModified', description='The timestamp when the alert template was modified.

Unit: milliseconds.', example='1646054798000'),
      name?: string(name='Name', description='The name of the alert template.', example='ECS_Template1'),
      restVersion?: long(name='RestVersion', description='The version of the alert template.

Default value: 0.', example='0'),
      templateId?: long(name='TemplateId', description='The ID of the alert template.', example='70****'),
    }
  ](name='Template')
  }(name='Templates', description='The queried alert templates.'),
  total?: long(name='Total', description='The total number of entries returned.', example='2'),
}

model DescribeMetricRuleTemplateListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricRuleTemplateListResponseBody(name='body'),
}

/**
 * @summary Queries alert templates.
 *
 * @description This topic provides an example on how to query alert templates. In this example, the following alert templates are returned in the response: `ECS_Template1` and `ECS_Template2`.
 *
 * @param request DescribeMetricRuleTemplateListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricRuleTemplateListResponse
 */
async function describeMetricRuleTemplateListWithOptions(request: DescribeMetricRuleTemplateListRequest, runtime: Util.RuntimeOptions): DescribeMetricRuleTemplateListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.history)) {
    query['History'] = request.history;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.orderBy)) {
    query['OrderBy'] = request.orderBy;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricRuleTemplateList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries alert templates.
 *
 * @description This topic provides an example on how to query alert templates. In this example, the following alert templates are returned in the response: `ECS_Template1` and `ECS_Template2`.
 *
 * @param request DescribeMetricRuleTemplateListRequest
 * @return DescribeMetricRuleTemplateListResponse
 */
async function describeMetricRuleTemplateList(request: DescribeMetricRuleTemplateListRequest): DescribeMetricRuleTemplateListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricRuleTemplateListWithOptions(request, runtime);
}

model DescribeMetricTopRequest {
  dimensions?: string(name='Dimensions', description='The monitoring dimensions of the specified resource.

Set the value to a collection of `key:value` pairs. Example: `{"userId":"120886317861****"}` or `{"instanceId":"i-2ze2d6j5uhg20x47****"}`.

>  You can query a maximum of 50 instances in each request.', example='[{"instanceId": "i-abcdefgh12****"}]'),
  endTime?: string(name='EndTime', description='The end of the time range to query monitoring data.

*   If the `StartTime` and `EndTime` parameters are not specified, the monitoring data of the last statistical period is queried.``

*   If the `StartTime` and `EndTime` parameters are specified, the monitoring data of the last statistical period in the specified time range is queried.````

    *   If you set the `Period` parameter to 15, the specified time range must be less than or equal to 20 minutes. For example, if you set the StartTime parameter to 2021-05-08 08:10:00 and the EndTime parameter to 2021-05-08 08:30:00, the monitoring data of the last 15 seconds in the time range is queried.
    *   If you set the `Period` parameter to 60 or 900, the specified time range must be less than or equal to 2 hours. For example, if you set the Period parameter to 60, the StartTime parameter to 2021-05-08 08:00:00, and the EndTime parameter to 2021-05-08 10:00:00, the monitoring data of the last 60 seconds in the time range is queried.
    *   If you set the `Period` parameter to 3600, the specified time range must be less than or equal to two days. For example, if you set the StartTime parameter to 2021-05-08 08:00:00 and the EndTime parameter to 2021-05-10 08:00:00, the monitoring data of the last 3,600 seconds in the time range is queried.

The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   Time format: YYYY-MM-DDThh:mm:ssZ

>  We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='2021-05-08 10:00:00'),
  express?: string(name='Express', description='The expression that is used to compute the query results in real time.

>  Only the `groupby` expression is supported. This expression is similar to the GROUP BY statement used in databases.', example='{"groupby":["userId","instanceId"]}'),
  length?: string(name='Length', description='The number of entries per page.

Default value: 10.

>  The maximum value of the Length parameter in a request is 1440.', example='10'),
  metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.

For more information about metric names, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_idle'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  orderDesc?: string(name='OrderDesc', description='The order in which data is sorted. Valid values:

*   True: sorts data in ascending order.
*   False (default): sorts data in descending order.', example='False'),
  orderby?: string(name='Orderby', description='The field based on which data is sorted. Valid values:

*   Average
*   Minimum
*   Maximum

This parameter is required.', example='Average'),
  period?: string(name='Period', description='The statistical period of the monitoring data.

Valid values: 15, 60, 900, and 3600.

Unit: seconds.

> 

*   If this parameter is not specified, monitoring data is queried based on the period in which metric values are reported.

*   Statistical periods vary based on the metrics that are specified by `MetricName`. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The start of the time range to query monitoring data.

*   If the `StartTime` and `EndTime` parameters are not specified, the monitoring data of the last statistical period is queried.``

*   If the `StartTime` and `EndTime` parameters are specified, the monitoring data of the last statistical period in the specified time range is queried.````

    *   If you set the `Period` parameter to 15, the specified time range must be less than or equal to 20 minutes. For example, if you set the StartTime parameter to 2021-05-08 08:10:00 and the EndTime parameter to 2021-05-08 08:30:00, the monitoring data of the last 15 seconds in the time range is queried.
    *   If you set the `Period` parameter to 60 or 900, the specified time range must be less than or equal to 2 hours. For example, if you set the Period parameter to 60, the StartTime parameter to 2021-05-08 08:00:00, and the EndTime parameter to 2021-05-08 10:00:00, the monitoring data of the last 60 seconds in the time range is queried.
    *   If you set the `Period` parameter to 3600, the specified time range must be less than or equal to two days. For example, if you set the StartTime parameter to 2021-05-08 08:00:00 and the EndTime parameter to 2021-05-10 08:00:00, the monitoring data of the last 3,600 seconds in the time range is queried.

The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   Time format: YYYY-MM-DDThh:mm:ssZ

> 

*   You must set the `StartTime` parameter to a point in time that is later than 00:00:00 Thursday, January 1, 1970. Otherwise, this parameter is invalid.

*   We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='2021-05-08 08:00:00'),
}

model DescribeMetricTopResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  datapoints?: string(name='Datapoints', description='The monitoring data.', example='[{\\\\"order\\\\":1,\\\\"timestamp\\\\":1620287520000,\\\\"userId\\\\":\\\\"120886317861****\\\\",\\\\"instanceId\\\\":\\\\"i-j6ccf7d5fn335qpo****\\\\",\\\\"Average\\\\":99.92,\\\\"Minimum\\\\":99.5,\\\\"Maximum\\\\":100.0,\\\\"_count\\\\":1.0},{\\\\"order\\\\":2,\\\\"timestamp\\\\":1620287520000,\\\\"userId\\\\":\\\\"120886317861****\\\\",\\\\"instanceId\\\\":\\\\"i-0xii2bvf42iqvxbp****\\\\",\\\\"Average\\\\":99.91,\\\\"Minimum\\\\":99.0,\\\\"Maximum\\\\":100.0,\\\\"_count\\\\":1.0}]'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  period?: string(name='Period', description='The statistical period of the monitoring data. Unit: seconds. Valid values: 15, 60, 900, and 3600.', example='60'),
  requestId?: string(name='RequestId', description='The request ID.', example='3121AE7D-4AFF-4C25-8F1D-C8226EBB1F42'),
}

model DescribeMetricTopResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMetricTopResponseBody(name='body'),
}

/**
 * @summary Queries the latest monitoring data of a metric for a cloud service. The data can be sorted by a specified order.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 10 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * ### [](#)Precautions
 * The storage duration of the monitoring data of each cloud service is related to the `Period` parameter (statistical period). A larger value of the `Period` parameter indicates that the monitoring data is distributed in a larger time range and the storage duration of the monitoring data is longer. The following list describes the specific relationships:
 * *   If the value of the `Period` parameter is less than 60 seconds, the storage duration is seven days.
 * *   If the value of the `Period` parameter is 60 seconds, the storage duration is 31 days.
 * *   If the value of the `Period` parameter is 300 seconds, the storage duration is 91 days.
 * ### [](#)Description
 * This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric in the last 60 seconds for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The monitoring data is sorted in the descending order based on the `Average` field.
 *
 * @param request DescribeMetricTopRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMetricTopResponse
 */
async function describeMetricTopWithOptions(request: DescribeMetricTopRequest, runtime: Util.RuntimeOptions): DescribeMetricTopResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.express)) {
    query['Express'] = request.express;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.orderDesc)) {
    query['OrderDesc'] = request.orderDesc;
  }
  if (!Util.isUnset(request.orderby)) {
    query['Orderby'] = request.orderby;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMetricTop',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the latest monitoring data of a metric for a cloud service. The data can be sorted by a specified order.
 *
 * @description ### [](#)Limits
 * Each API operation can be called up to 10 times per second. An Alibaba Cloud account and the RAM users within the account share the quota.
 * ### [](#)Precautions
 * The storage duration of the monitoring data of each cloud service is related to the `Period` parameter (statistical period). A larger value of the `Period` parameter indicates that the monitoring data is distributed in a larger time range and the storage duration of the monitoring data is longer. The following list describes the specific relationships:
 * *   If the value of the `Period` parameter is less than 60 seconds, the storage duration is seven days.
 * *   If the value of the `Period` parameter is 60 seconds, the storage duration is 31 days.
 * *   If the value of the `Period` parameter is 300 seconds, the storage duration is 91 days.
 * ### [](#)Description
 * This topic provides an example to show how to query the monitoring data of the `cpu_idle` metric in the last 60 seconds for Elastic Compute Service (ECS). The namespace of ECS is `acs_ecs_dashboard`. The monitoring data is sorted in the descending order based on the `Average` field.
 *
 * @param request DescribeMetricTopRequest
 * @return DescribeMetricTopResponse
 */
async function describeMetricTop(request: DescribeMetricTopRequest): DescribeMetricTopResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMetricTopWithOptions(request, runtime);
}

model DescribeMonitorGroupCategoriesRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitorGroupCategoriesResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message returned.', example='The specified resource is not found.'),
  monitorGroupCategories?: {
    groupId?: long(name='GroupId', description='The ID of the application group.', example='123456'),
    monitorGroupCategory?: {
      categoryItem?: [ 
      {
        category?: string(name='Category', description='The abbreviation of the cloud service name.

>  For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.', example='ECS'),
        count?: int32(name='Count', description='The number of resources that belong to the cloud service.', example='1'),
      }
    ](name='CategoryItem')
    }(name='MonitorGroupCategory', description='The cloud services to which the resources in the application group belong and the number of resources that belong to the cloud service.'),
  }(name='MonitorGroupCategories', description='The cloud services to which the resources in the application group belong and the number of resources that belong to the cloud service.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9E0347B0-EBC3-4769-A78D-D96F21C6BB52'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
}

model DescribeMonitorGroupCategoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupCategoriesResponseBody(name='body'),
}

/**
 * @summary Queries the cloud services to which the resources in an application group belong and the number of resources that belong to each cloud service in the application group.
 *
 * @param request DescribeMonitorGroupCategoriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupCategoriesResponse
 */
async function describeMonitorGroupCategoriesWithOptions(request: DescribeMonitorGroupCategoriesRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupCategoriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroupCategories',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the cloud services to which the resources in an application group belong and the number of resources that belong to each cloud service in the application group.
 *
 * @param request DescribeMonitorGroupCategoriesRequest
 * @return DescribeMonitorGroupCategoriesResponse
 */
async function describeMonitorGroupCategories(request: DescribeMonitorGroupCategoriesRequest): DescribeMonitorGroupCategoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupCategoriesWithOptions(request, runtime);
}

model DescribeMonitorGroupDynamicRulesRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitorGroupDynamicRulesResponseBody = {
  code?: int32(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2170B94A-1576-4D65-900E-2093037CDAF3'),
  resource?: {
    resource?: [ 
    {
      category?: string(name='Category', description='The type of the cloud service to which the dynamic rule belongs. Valid values:

*   ecs: Elastic Compute Service (ECS)
*   rds: ApsaraDB RDS
*   slb: Server Load Balancer (SLB)', example='ecs'),
      filterRelation?: string(name='FilterRelation', description='The filter condition. Valid values:

*   and: queries the instances that meet all alert rules.
*   or: queries the instances that meet any alert rule.', example='and'),
      filters?: {
        filter?: [ 
        {
          function?: string(name='Function', description='The method that is used to filter the instances. Valid values:

*   contains: contains
*   startWith: starts with a prefix
*   endWith: ends with a suffix', example='contains'),
          name?: string(name='Name', description='The instance name.', example='hostName'),
          value?: string(name='Value', description='The value of the dynamic rule.', example='1'),
        }
      ](name='Filter')
      }(name='Filters', description='The dynamic rules of the application group.'),
    }
  ](name='Resource')
  }(name='Resource', description='The resources that are associated with the application group.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMonitorGroupDynamicRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupDynamicRulesResponseBody(name='body'),
}

/**
 * @summary Queries the dynamic rules of an application group.
 *
 * @param request DescribeMonitorGroupDynamicRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupDynamicRulesResponse
 */
async function describeMonitorGroupDynamicRulesWithOptions(request: DescribeMonitorGroupDynamicRulesRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupDynamicRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroupDynamicRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the dynamic rules of an application group.
 *
 * @param request DescribeMonitorGroupDynamicRulesRequest
 * @return DescribeMonitorGroupDynamicRulesResponse
 */
async function describeMonitorGroupDynamicRules(request: DescribeMonitorGroupDynamicRulesRequest): DescribeMonitorGroupDynamicRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupDynamicRulesWithOptions(request, runtime);
}

model DescribeMonitorGroupInstanceAttributeRequest {
  category?: string(name='Category', description='The abbreviation of the cloud service name.

For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.', example='ecs'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  instanceIds?: string(name='InstanceIds', description='The resource ID. Separate multiple resource IDs with commas (,). You can query the details about a maximum of 20 resources at a time.', example='i-m5e0k0bexac8tykr****'),
  keyword?: string(name='Keyword', description='The keyword that is used to search for resources.', example='portal'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Valid values: 1 to 1000000000.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 1000000000.

Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  total?: boolean(name='Total', description='Specifies whether to return the total number of resources in the specified application group. Valid values:

*   true (default)
*   false', example='true'),
}

model DescribeMonitorGroupInstanceAttributeResponseBody = {
  code?: int32(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='2'),
  requestId?: string(name='RequestId', description='The request ID.', example='9FB8EA79-7279-4482-8D6D-3D28EEDD871A'),
  resources?: {
    resource?: [ 
    {
      category?: string(name='Category', description='The name of the cloud service.', example='ecs'),
      desc?: string(name='Desc', description='The resource description.', example='desc_test'),
      dimension?: string(name='Dimension', description='The dimensions of the resource that is associated with the application group.', example='{"instanceId":"i-m5e0k0bexac8tykr****"}'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='i-m5e0k0bexac8tykr****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='hostName'),
      networkType?: string(name='NetworkType', description='The network type.', example='vpc'),
      region?: {
        availabilityZone?: string(name='AvailabilityZone', description='The zone.', example='cn-hangzhou-f'),
        regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      }(name='Region', description='The region.'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='instanceNetworkType'),
          value?: string(name='Value', description='The tag value.', example='VPC'),
        }
      ](name='Tag')
      }(name='Tags', description='The tag of the resource.'),
      vpc?: {
        vpcInstanceId?: string(name='VpcInstanceId', description='The VPC ID.', example='vpc-2zew7etgiceg21****'),
        vswitchInstanceId?: string(name='VswitchInstanceId', description='The vSwitch ID.', example='vsw-2ze36seq79n992****'),
      }(name='Vpc', description='The VPC description.'),
    }
  ](name='Resource')
  }(name='Resources', description='The resources that are associated with the application group.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='12'),
}

model DescribeMonitorGroupInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of the resources in an application group.
 *
 * @param request DescribeMonitorGroupInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupInstanceAttributeResponse
 */
async function describeMonitorGroupInstanceAttributeWithOptions(request: DescribeMonitorGroupInstanceAttributeRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.total)) {
    query['Total'] = request.total;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroupInstanceAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of the resources in an application group.
 *
 * @param request DescribeMonitorGroupInstanceAttributeRequest
 * @return DescribeMonitorGroupInstanceAttributeResponse
 */
async function describeMonitorGroupInstanceAttribute(request: DescribeMonitorGroupInstanceAttributeRequest): DescribeMonitorGroupInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupInstanceAttributeWithOptions(request, runtime);
}

model DescribeMonitorGroupInstancesRequest {
  category?: string(name='Category', description='The abbreviation of the cloud service name. Valid values of N: 1 to 200.

>  For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.', example='ecs'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='12345'),
  instanceIds?: string(name='InstanceIds', description='The instance ID. You can query multiple instances by specifying multiple IDs.', example='i-x1234568'),
  keyword?: string(name='Keyword', description='The keyword used to search for instances. Fuzzy search based on instance names is supported.', example='s1'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitorGroupInstancesResponseBody = {
  code?: int32(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='97F2A410-9412-499C-9AD1-76EF7EC02DF2'),
  resources?: {
    resource?: [ 
    {
      category?: string(name='Category', description='The abbreviation of the service name.', example='ecs'),
      id?: long(name='Id', description='The resource ID.', example='12345'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='i-2ze3w55tr2r****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='hostIP'),
      regionId?: string(name='RegionId', description='The ID of the region where the instance resides.', example='cn-hangzhou'),
    }
  ](name='Resource')
  }(name='Resources', description='The information about the resources in the application group.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful.', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='12'),
}

model DescribeMonitorGroupInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the resources in an application group.
 *
 * @param request DescribeMonitorGroupInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupInstancesResponse
 */
async function describeMonitorGroupInstancesWithOptions(request: DescribeMonitorGroupInstancesRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroupInstances',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resources in an application group.
 *
 * @param request DescribeMonitorGroupInstancesRequest
 * @return DescribeMonitorGroupInstancesResponse
 */
async function describeMonitorGroupInstances(request: DescribeMonitorGroupInstancesRequest): DescribeMonitorGroupInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupInstancesWithOptions(request, runtime);
}

model DescribeMonitorGroupNotifyPolicyListRequest {
  groupId?: string(name='GroupId', description='The ID of the application group.', example='6780****'),
  pageNumber?: int32(name='PageNumber', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='100'),
  policyType?: string(name='PolicyType', description='The policy type.

Valid value: PauseNotify.

This parameter is required.', example='PauseNotify'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitorGroupNotifyPolicyListResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  notifyPolicyList?: {
    notifyPolicy?: [ 
    {
      endTime?: long(name='EndTime', description='The end of the time range to query.

Unit: milliseconds.', example='1551761781273'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='6780****'),
      id?: string(name='Id', description='The policy ID.', example='123****'),
      startTime?: long(name='StartTime', description='The beginning of the time range to query.

Unit: milliseconds.', example='1551761781273'),
      type?: string(name='Type', description='The policy type.', example='PauseNotify'),
    }
  ](name='NotifyPolicy')
  }(name='NotifyPolicyList', description='The returned policies.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6072F026-C441-41A6-B114-35A1E8F8FDD3'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of entries returned.', example='11'),
}

model DescribeMonitorGroupNotifyPolicyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupNotifyPolicyListResponseBody(name='body'),
}

/**
 * @summary Queries the policies that are used to pause alert notifications for an application group.
 *
 * @param request DescribeMonitorGroupNotifyPolicyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupNotifyPolicyListResponse
 */
async function describeMonitorGroupNotifyPolicyListWithOptions(request: DescribeMonitorGroupNotifyPolicyListRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupNotifyPolicyListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.policyType)) {
    query['PolicyType'] = request.policyType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroupNotifyPolicyList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the policies that are used to pause alert notifications for an application group.
 *
 * @param request DescribeMonitorGroupNotifyPolicyListRequest
 * @return DescribeMonitorGroupNotifyPolicyListResponse
 */
async function describeMonitorGroupNotifyPolicyList(request: DescribeMonitorGroupNotifyPolicyListRequest): DescribeMonitorGroupNotifyPolicyListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupNotifyPolicyListWithOptions(request, runtime);
}

model DescribeMonitorGroupsRequest {
  dynamicTagRuleId?: string(name='DynamicTagRuleId', description='The ID of the tag rule.', example='6b882d9a-5117-42e2-9d0c-4749a0c6****'),
  groupFounderTagKey?: string(name='GroupFounderTagKey', description='The tag key that is created for the application group by using the tag rule.', example='GroupKey1'),
  groupFounderTagValue?: string(name='GroupFounderTagValue', description='The tag value that is created for the application group by using the tag rule.', example='GroupValue1'),
  groupId?: string(name='GroupId', description='The ID of the application group. Separate multiple application group IDs with commas (,).', example='92****'),
  groupName?: string(name='GroupName', description='The name of the application group.', example='testGroup124'),
  includeTemplateHistory?: boolean(name='IncludeTemplateHistory', description='Specifies whether to include the historical alert templates that are applied to the application group in the response. Valid values:

*   true
*   false', example='true'),
  instanceId?: string(name='InstanceId', description='The instance ID. This parameter is used to query the application group to which the specified instance belongs.', example='i-abcdefgh12****'),
  keyword?: string(name='Keyword', description='The keyword that is used for the search.', example='test'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Pages start from page 1. Default value: 30.', example='30'),
  regionId?: string(name='RegionId'),
  selectContactGroups?: boolean(name='SelectContactGroups', description='Specifies whether to include the alert contact groups in the response. Valid values:

*   true
*   false', example='true'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key of the application group. Valid values of N: 1 to 5.', example='tagKey1'),
      value?: string(name='Value', description='The tag value of the application group. Valid values of N: 1 to 5.', example='tagValue1'),
    }
  ](name='Tag', description='The tags of the application group.'),
  type?: string(name='Type', description='The type of the application group. Valid values:

*   custom: a self-managed application group
*   ehpc_cluster: an application group that is synchronized from an Elastic High Performance Computing (E-HPC) cluster
*   kubernetes: an application group that is synchronized from a Container Service for Kubernetes (ACK) cluster', example='custom'),
  types?: string(name='Types', description='The type of the application group. Valid values:

*   custom: a self-managed application group
*   ehpc_cluster: an application group that is synchronized from an Elastic High Performance Computing (E-HPC) cluster
*   kubernetes: an application group that is synchronized from a Container Service for Kubernetes (ACK) cluster
*   tag: an application group that is automatically created by using tags
*   resMgr: an application group that is created by using resource groups
*   ess: an application group that is synchronized from Auto Scaling (ESS)', example='custom'),
}

model DescribeMonitorGroupsResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='30'),
  requestId?: string(name='RequestId', description='The request ID.', example='F02B299A-D374-4595-9F55-7534D604F132'),
  resources?: {
    resource?: [ 
    {
      bindUrl?: string(name='BindUrl', description='The URL of the ACK cluster from which the application group is synchronized.', example='https://aliyun.com'),
      contactGroups?: {
        contactGroup?: [ 
        {
          name?: string(name='Name', description='The name of the alert contact group.', example='CloudMonitor'),
        }
      ](name='ContactGroup')
      }(name='ContactGroups', description='The alert contact groups.'),
      dynamicTagRuleId?: string(name='DynamicTagRuleId', description='The ID of the tag rule.', example='6b882d9a-5117-42e2-9d0c-4749a0c6****'),
      gmtCreate?: long(name='GmtCreate', description='The timestamp when the application group was created. Unit: milliseconds.', example='1603181891000'),
      gmtModified?: long(name='GmtModified', description='The timestamp when the application group was modified. Unit: milliseconds.', example='1603181891000'),
      groupFounderTagKey?: string(name='GroupFounderTagKey', description='The tag key that is created for the application group by using the tag rule.', example='GroupKey1'),
      groupFounderTagValue?: string(name='GroupFounderTagValue', description='The tag value that is created for the application group by using the tag rule.', example='GroupValue1'),
      groupId?: long(name='GroupId', description='The ID of the application group.', example='12345'),
      groupName?: string(name='GroupName', description='The name of the application group.', example='test123'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource ID.', example='rg-aek2hopjh*******'),
      serviceId?: string(name='ServiceId', description='The ID of the Alibaba Cloud service.', example='49****'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', description='The tag key of the application group.', example='tagKey1'),
          value?: string(name='Value', description='The tag value of the application group.', example='tagValue1'),
        }
      ](name='Tag')
      }(name='Tags', description='The tags that are attached to the application group.'),
      templateIds?: {
        templateId?: [ string ](name='TemplateId')
      }(name='TemplateIds', description='The ID of the template.'),
      type?: string(name='Type', description='The type of the application group. Valid values:

*   custom: a self-managed application group
*   ehpc_cluster: an application group that is synchronized from an E-HPC cluster
*   kubernetes: an application group that is synchronized from an ACK cluster', example='custom'),
    }
  ](name='Resource')
  }(name='Resources', description='The resources that are associated with the application group.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  total?: int32(name='Total', description='The total number of returned entries.', example='10'),
}

model DescribeMonitorGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorGroupsResponseBody(name='body'),
}

/**
 * @summary Queries application groups.
 *
 * @description This topic provides an example of how to query the application groups of the current account. The response shows that the current account has two application groups: `testGroup124` and `test123`.
 *
 * @param request DescribeMonitorGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorGroupsResponse
 */
async function describeMonitorGroupsWithOptions(request: DescribeMonitorGroupsRequest, runtime: Util.RuntimeOptions): DescribeMonitorGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dynamicTagRuleId)) {
    query['DynamicTagRuleId'] = request.dynamicTagRuleId;
  }
  if (!Util.isUnset(request.groupFounderTagKey)) {
    query['GroupFounderTagKey'] = request.groupFounderTagKey;
  }
  if (!Util.isUnset(request.groupFounderTagValue)) {
    query['GroupFounderTagValue'] = request.groupFounderTagValue;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.includeTemplateHistory)) {
    query['IncludeTemplateHistory'] = request.includeTemplateHistory;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.selectContactGroups)) {
    query['SelectContactGroups'] = request.selectContactGroups;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.types)) {
    query['Types'] = request.types;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorGroups',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries application groups.
 *
 * @description This topic provides an example of how to query the application groups of the current account. The response shows that the current account has two application groups: `testGroup124` and `test123`.
 *
 * @param request DescribeMonitorGroupsRequest
 * @return DescribeMonitorGroupsResponse
 */
async function describeMonitorGroups(request: DescribeMonitorGroupsRequest): DescribeMonitorGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorGroupsWithOptions(request, runtime);
}

model DescribeMonitorResourceQuotaAttributeRequest {
  regionId?: string(name='RegionId'),
  showUsed?: boolean(name='ShowUsed', description='Specifies whether to return information about used quotas. Valid values:

*   true (default): yes
*   false: no', example='true'),
}

model DescribeMonitorResourceQuotaAttributeResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='31BC7201-00F2-47B2-B7B9-6A173076ACE'),
  resourceQuota?: {
    api?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of API calls. Unit: 10,000 calls.', example='500'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of API calls in your resource plan. Unit: 10,000 calls.', example='500'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of API calls in your resource plan. Unit: calls.', example='9987'),
    }(name='Api', description='The details about the quota of API calls.'),
    customMonitor?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of the time series for custom monitoring.', example='1200'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of the time series for custom monitoring in your resource plan.', example='1000'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of the time series for custom monitoring in your resource plan.', example='8'),
    }(name='CustomMonitor', description='The details about the quota for custom monitoring.'),
    enterpriseQuota?: {
      instanceId?: string(name='InstanceId', description='The ID of the instance monitored by Hybrid Cloud Monitoring.', example='cms_enterprise_public_cn-7mz27pd****'),
      suitInfo?: string(name='SuitInfo', description='The description of Hybrid Cloud Monitoring.', example='ENTERPRISE'),
    }(name='EnterpriseQuota', description='The details about the quota of Hybrid Cloud Monitoring.'),
    eventMonitor?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of events that can be reported in event monitoring. The total quota is the value that is multiplied by 10,000.', example='55'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of events that can be reported in event monitoring in your resource plan. The total quota is the value that is multiplied by 10,000.', example='50'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of events that can be reported in event monitoring in your resource plan. The total quota is the value that is multiplied by 10,000.', example='2'),
    }(name='EventMonitor', description='The details about the quota for event monitoring.'),
    expireTime?: string(name='ExpireTime', description='The time when the resource plan expires.', example='2021-02-28'),
    instanceId?: string(name='InstanceId', description='The ID of the resource plan.', example='cms_edition-cn-n6w20rn****'),
    logMonitor?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of processed log data in log monitoring. Unit: MB/min.', example='150'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of processed log data in log monitoring in your resource plan. Unit: MB/min.', example='150'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of processed log data in log monitoring in your resource plan. Unit: MB/min.', example='80'),
    }(name='LogMonitor', description='The details about the quota for log monitoring.'),
    phone?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of alert phone calls. Unit: calls.', example='550'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of alert phone calls in your resource plan. Unit: calls.', example='500'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of alert phone calls in your resource plan. Unit: calls.', example='100'),
    }(name='Phone', description='The details about the quota of alert phone calls.'),
    SMS?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of alert text messages. Unit: messages.', example='550'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of alert text messages in your resource plan. Unit: messages.', example='500'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of alert text messages in your resource plan. Unit: messages.', example='38'),
    }(name='SMS', description='The details about the quota of alert text messages.'),
    siteMonitorBrowser?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of browser detection tasks.', example='50'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of browser detection tasks in your resource plan.', example='50'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of browser detection tasks in your resource plan.', example='15'),
    }(name='SiteMonitorBrowser', description='The quota of browser detection tasks.'),
    siteMonitorEcsProbe?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of ECS detection points for site monitoring.

> The value indicates the maximum number of ECS detection points that you can select for a site monitoring task.', example='5'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of ECS detection points for site monitoring in your resource plan.', example='5'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of ECS detection points for site monitoring in your resource plan.

> The value indicates the total number of ECS detection points that are used by existing site monitoring tasks.', example='20'),
    }(name='SiteMonitorEcsProbe', description='The details about the quota of ECS detection points for site monitoring.'),
    siteMonitorMobile?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of mobile detection tasks.', example='50'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of mobile detection tasks in your resource plan.', example='50'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of mobile detection tasks in your resource plan.', example='15'),
    }(name='SiteMonitorMobile', description='The quota of mobile detection tasks.'),
    siteMonitorOperatorProbe?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of carrier detection points for site monitoring.', example='5'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of carrier detection points for site monitoring in your resource plan.', example='5'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of carrier detection points for site monitoring in your resource plan.', example='0'),
    }(name='SiteMonitorOperatorProbe', description='The details about the quota of carrier detection points for site monitoring.'),
    siteMonitorTask?: {
      quotaLimit?: int32(name='QuotaLimit', description='The total quota of site monitoring tasks.', example='25'),
      quotaPackage?: int32(name='QuotaPackage', description='The quota of site monitoring tasks in your resource plan.', example='20'),
      quotaUsed?: int32(name='QuotaUsed', description='The used quota of site monitoring tasks in your resource plan.', example='15'),
    }(name='SiteMonitorTask', description='The quota of site monitoring tasks.'),
    suitInfo?: string(name='SuitInfo', description='The current edition of CloudMonitor. Valid values:

*   free: Free Edition
*   pro: Pro Edition
*   cms_post: pay-as-you-go', example='pro'),
  }(name='ResourceQuota', description='The details about the resource quotas of CloudMonitor.'),
}

model DescribeMonitorResourceQuotaAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitorResourceQuotaAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the resource quotas of CloudMonitor.
 *
 * @param request DescribeMonitorResourceQuotaAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitorResourceQuotaAttributeResponse
 */
async function describeMonitorResourceQuotaAttributeWithOptions(request: DescribeMonitorResourceQuotaAttributeRequest, runtime: Util.RuntimeOptions): DescribeMonitorResourceQuotaAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.showUsed)) {
    query['ShowUsed'] = request.showUsed;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitorResourceQuotaAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the resource quotas of CloudMonitor.
 *
 * @param request DescribeMonitorResourceQuotaAttributeRequest
 * @return DescribeMonitorResourceQuotaAttributeResponse
 */
async function describeMonitorResourceQuotaAttribute(request: DescribeMonitorResourceQuotaAttributeRequest): DescribeMonitorResourceQuotaAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitorResourceQuotaAttributeWithOptions(request, runtime);
}

model DescribeMonitoringAgentAccessKeyRequest {
  regionId?: string(name='RegionId'),
}

model DescribeMonitoringAgentAccessKeyResponseBody = {
  accessKey?: string(name='AccessKey', description='The AccessKey ID that is required to install the agent.', example='E7A27f9****'),
  code?: int32(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C0F655E9-D793-51E6-BD78-CABBCCFC1047'),
  secretKey?: string(name='SecretKey', description='The AccessKey secret that is required to install the agent.', example='sBjNOUhLylrxMX-Xv1****'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMonitoringAgentAccessKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringAgentAccessKeyResponseBody(name='body'),
}

/**
 * @summary Queries the AccessKey ID and AccessKey secret that are required to install the CloudMonitor agent on a third-party host.
 *
 * @param request DescribeMonitoringAgentAccessKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringAgentAccessKeyResponse
 */
async function describeMonitoringAgentAccessKeyWithOptions(request: DescribeMonitoringAgentAccessKeyRequest, runtime: Util.RuntimeOptions): DescribeMonitoringAgentAccessKeyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringAgentAccessKey',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the AccessKey ID and AccessKey secret that are required to install the CloudMonitor agent on a third-party host.
 *
 * @param request DescribeMonitoringAgentAccessKeyRequest
 * @return DescribeMonitoringAgentAccessKeyResponse
 */
async function describeMonitoringAgentAccessKey(request: DescribeMonitoringAgentAccessKeyRequest): DescribeMonitoringAgentAccessKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringAgentAccessKeyWithOptions(request, runtime);
}

model DescribeMonitoringAgentConfigRequest {
  regionId?: string(name='RegionId'),
}

model DescribeMonitoringAgentConfigResponseBody = {
  autoInstall?: boolean(name='AutoInstall', description='Indicates whether the Cloud Monitor agent is automatically installed on existing Elastic Compute Service (ECS) instances. Valid values:

*   true
*   false', example='true'),
  code?: string(name='Code', description='The status code.

>  The status code 200 indicates a success.', example='200'),
  enableActiveAlert?: string(name='EnableActiveAlert', description='The service for which one-click alert is enabled.', example='redis,rds,ecs'),
  enableInstallAgentNewECS?: boolean(name='EnableInstallAgentNewECS', description='Indicates whether the Cloud Monitor agent is automatically installed on new ECS instances. Valid values:

*   true
*   false', example='true'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E9F4FA2A-54BE-4EF9-9D1D-1A0B1DC86B8D'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   true: successful.
*   false: failed.', example='true'),
}

model DescribeMonitoringAgentConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringAgentConfigResponseBody(name='body'),
}

/**
 * @param request DescribeMonitoringAgentConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringAgentConfigResponse
 */
async function describeMonitoringAgentConfigWithOptions(request: DescribeMonitoringAgentConfigRequest, runtime: Util.RuntimeOptions): DescribeMonitoringAgentConfigResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringAgentConfig',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeMonitoringAgentConfigRequest
 * @return DescribeMonitoringAgentConfigResponse
 */
async function describeMonitoringAgentConfig(request: DescribeMonitoringAgentConfigRequest): DescribeMonitoringAgentConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringAgentConfigWithOptions(request, runtime);
}

model DescribeMonitoringAgentHostsRequest {
  aliyunHost?: boolean(name='AliyunHost', description='Specifies whether to query Elastic Compute Service (ECS) instances that are provided by Alibaba Cloud or to query hosts that are not provided by Alibaba Cloud. Valid values:

*   true (default value): queries all the ECS instances that are provided by Alibaba Cloud.
*   false: queries all the hosts that are not provided by Alibaba Cloud.', example='true'),
  hostName?: string(name='HostName', description='The name of the host.', example='hostNam1'),
  instanceIds?: string(name='InstanceIds', description='The ID of the instance.', example='i-a3d1q1pm2f9yr29e****'),
  instanceRegionId?: string(name='InstanceRegionId', description='The region ID of the instance.', example='cn-hangzhou'),
  keyWord?: string(name='KeyWord', description='The keyword that is used in fuzzy match.', example='host1'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values:

*   10
*   20
*   50
*   100

> Although Alibaba Cloud does not limit the maximum value of this parameter, we recommend that you do not set it to an excessively large value. If you set it to an excessively large value, a timeout error may occur.', example='10'),
  regionId?: string(name='RegionId'),
  serialNumbers?: string(name='SerialNumbers', description='The serial number of the host.

After the CloudMonitor agent is installed on a host, a globally unique serial number is generated. A host that is not provided by Alibaba Cloud has a serial number instead of an instance ID.

> This parameter can be used to accurately search for a monitored host.', example='a1ab31a3-1234-40f2-9e95-c8caa8f0****'),
  status?: string(name='Status', description='The status of the hosts that you want to query. Valid values:

*   Running: queries the hosts that are running.
*   Stopped: queries the hosts that are stopped, are not installed, or fail to be installed.', example='Running'),
  sysomStatus?: string(name='SysomStatus', description='The status of SysOM. Valid values:

*   installing: SysOM is being installed.
*   running: SysOM is running.
*   stopped: SysOM is stopped.
*   uninstalling: SysOM is being uninstalled.', example='running'),
}

model DescribeMonitoringAgentHostsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the call is successful.', example='200'),
  hosts?: {
    host?: [ 
    {
      agentVersion?: string(name='AgentVersion', description='The version of the CloudMonitor agent.', example='3.4.6'),
      aliUid?: long(name='AliUid', description='The ID of the Alibaba Cloud account.', example='103201326074****'),
      eipAddress?: string(name='EipAddress', description='The elastic IP address (EIP) of the host.', example='192.168.XX.XX'),
      eipId?: string(name='EipId', description='The ID of the EIP.', example='eip-bp16i16k9gcezyfrp****'),
      hostName?: string(name='HostName', description='The name of the host.', example='hostIP'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='i-a2d5q7pm3f9yr212****'),
      instanceTypeFamily?: string(name='InstanceTypeFamily', description='The type of the ECS instance.', example='ecs.n4'),
      ipGroup?: string(name='IpGroup', description='The IP address of the host.

> Multiple IP addresses are separated with commas (,).', example='192.168.XX.XX'),
      natIp?: string(name='NatIp', description='The IP address of the Network Address Translation (NAT) gateway.', example='192.168.XX.XX'),
      networkType?: string(name='NetworkType', description='The network type.', example='vpc'),
      operatingSystem?: string(name='OperatingSystem', description='The operating system.', example='Linux'),
      region?: string(name='Region', description='The ID of the region.', example='cn-hangzhou'),
      serialNumber?: string(name='SerialNumber', description='The serial number of the host. A host that is not provided by Alibaba Cloud has a serial number instead of an instance ID.

> This parameter can be used to accurately search for a monitored host.', example='x12335-6cc8-4a22-9f21-1a00a719****'),
      isAliyunHost?: boolean(name='isAliyunHost', description='Indicates whether the host is provided by Alibaba Cloud. Valid values:

*   true: The host is provided by Alibaba Cloud.
*   false: The host is not provided by Alibaba Cloud.', example='true'),
    }
  ](name='Host')
  }(name='Hosts', description='The information about the hosts.'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  pageNumber?: int32(name='PageNumber', description='The page number of the returned page.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries returned per page.', example='10'),
  pageTotal?: int32(name='PageTotal', description='The total number of returned pages.', example='50'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='63EEBB2A-9E51-41E4-9E83-5DE7F3B292E0'),
  success?: boolean(name='Success', description='Indicates whether the call is successful. Valid values:

*   true: The call is successful.
*   false: The call fails.', example='true'),
  total?: int32(name='Total', description='The total number of returned entries.', example='10'),
}

model DescribeMonitoringAgentHostsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringAgentHostsResponseBody(name='body'),
}

/**
 * @summary Queries all hosts within the current Alibaba Cloud account, including hosts on which the CloudMonitor agent is installed and uninstalled.
 *
 * @param request DescribeMonitoringAgentHostsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringAgentHostsResponse
 */
async function describeMonitoringAgentHostsWithOptions(request: DescribeMonitoringAgentHostsRequest, runtime: Util.RuntimeOptions): DescribeMonitoringAgentHostsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunHost)) {
    query['AliyunHost'] = request.aliyunHost;
  }
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!Util.isUnset(request.instanceRegionId)) {
    query['InstanceRegionId'] = request.instanceRegionId;
  }
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.serialNumbers)) {
    query['SerialNumbers'] = request.serialNumbers;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.sysomStatus)) {
    query['SysomStatus'] = request.sysomStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringAgentHosts',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries all hosts within the current Alibaba Cloud account, including hosts on which the CloudMonitor agent is installed and uninstalled.
 *
 * @param request DescribeMonitoringAgentHostsRequest
 * @return DescribeMonitoringAgentHostsResponse
 */
async function describeMonitoringAgentHosts(request: DescribeMonitoringAgentHostsRequest): DescribeMonitoringAgentHostsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringAgentHostsWithOptions(request, runtime);
}

model DescribeMonitoringAgentProcessesRequest {
  instanceId?: string(name='InstanceId', description='The ID of the instance.

This parameter is required.', example='i-hp3hl3cx1pbahzy8****'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitoringAgentProcessesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The value 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The specified resource is not found.'),
  nodeProcesses?: {
    nodeProcess?: [ 
    {
      command?: string(name='Command', description='The command used to obtain the number of processes. Valid value: `number`.

>  The `number` command obtains the number of processes that match the condition.', example='number'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='3619****'),
      instanceId?: string(name='InstanceId', description='The ID of the instance.', example='i-hp3hl3cx1pbahzy8****'),
      processId?: long(name='ProcessId', description='The ID of the process.', example='234567'),
      processName?: string(name='ProcessName', description='The name of the process.', example='Nginx'),
      processUser?: string(name='ProcessUser', description='The user who launched the process.', example='alice'),
    }
  ](name='NodeProcess')
  }(name='NodeProcesses', description='The information about the processes.'),
  requestId?: string(name='RequestId', description='The request ID.', example='C11C0E85-6862-4F25-8D66-D6A5E0882984'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeMonitoringAgentProcessesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringAgentProcessesResponseBody(name='body'),
}

/**
 * @description >  Before you call this operation, call the CreateMonitoringAgentProcess operation to create processes. For more information, see [CreateMonitoringAgentProcess](https://help.aliyun.com/document_detail/114951.html~).
 * This topic provides an example of how to query the processes of the `i-hp3hl3cx1pbahzy8****` instance. The response indicates the details of the `NGINX` and `HTTP` processes.
 *
 * @param request DescribeMonitoringAgentProcessesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringAgentProcessesResponse
 */
async function describeMonitoringAgentProcessesWithOptions(request: DescribeMonitoringAgentProcessesRequest, runtime: Util.RuntimeOptions): DescribeMonitoringAgentProcessesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringAgentProcesses',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description >  Before you call this operation, call the CreateMonitoringAgentProcess operation to create processes. For more information, see [CreateMonitoringAgentProcess](https://help.aliyun.com/document_detail/114951.html~).
 * This topic provides an example of how to query the processes of the `i-hp3hl3cx1pbahzy8****` instance. The response indicates the details of the `NGINX` and `HTTP` processes.
 *
 * @param request DescribeMonitoringAgentProcessesRequest
 * @return DescribeMonitoringAgentProcessesResponse
 */
async function describeMonitoringAgentProcesses(request: DescribeMonitoringAgentProcessesRequest): DescribeMonitoringAgentProcessesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringAgentProcessesWithOptions(request, runtime);
}

model DescribeMonitoringAgentStatusesRequest {
  hostAvailabilityTaskId?: string(name='HostAvailabilityTaskId', description='The ID of the availability monitoring task.', example='126****'),
  instanceIds?: string(name='InstanceIds', description='The instance IDs. Separate multiple instance IDs with commas (,).', example='i-hp3dunahluwajv6f****'),
  regionId?: string(name='RegionId'),
}

model DescribeMonitoringAgentStatusesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  nodeStatusList?: {
    nodeStatus?: [ 
    {
      agentInstallErrorCode?: string(name='AgentInstallErrorCode', description='The error code returned when the CloudMonitor agent is installed. Valid values:

*   Common.Timeout: The installation timed out.
*   Common.SLR: The service-linked role for CloudMonitor is unauthorized.
*   Common.OS: The operating system is not supported.
*   Assist.Invalid: Cloud Assistant is not running.
*   Assist.Invoke: An error occurred when the installation program is started.
*   Assist.Execute: An error occurred when the installation program is running.'),
      autoInstall?: boolean(name='AutoInstall', description='Indicates whether the CloudMonitor agent is automatically installed. Valid values:

*   true: The CloudMonitor agent is automatically installed.
*   false: The CloudMonitor agent is not automatically installed.', example='true'),
      instanceId?: string(name='InstanceId', description='The instance ID.', example='i-hp3dunahluwajv6f****'),
      osMonitorConfig?: string(name='OsMonitorConfig', description='Indicates whether the SysAK monitoring feature is enabled.`` Valid values:

*   `true`: The SysAK monitoring feature is enabled.
*   `false`: the SysAK monitoring feature is disabled.', example='{"sysak":true}'),
      osMonitorErrorCode?: string(name='OsMonitorErrorCode', description='The error status of SysOM. Valid values:

*   `install_fail`: SysOM fails to be installed or an unknown error occurs.
*   `install_assist_invalid`: SysOM fails to be installed because the status of Cloud Assistant is invalid.
*   `install_assist_command_fail`: SysOM fails to be installed because the installation command fails to run.
*   `uninstall_fail`: SysOM fails to be uninstalled or an unknown error occurs.
*   `uninstall_assist_invalid`: SysOM fails to be uninstalled because the status of Cloud Assistant is invalid.
*   `uninstall_assist_command_fail`: SysOM fails to be uninstalled because the uninstallation command fails to run.', example='install_fail'),
      osMonitorErrorDetail?: string(name='OsMonitorErrorDetail', description='The details of the execution error. Valid values:

*   `Command.ErrorCode.Fail.Downlaod.REGIN_ID`: Failed to obtain the region ID.
*   `Command.ErrorCode.Fail.Downlaod.SYSAK`: Failed to download the .rpm package of System Analyse Kit (SysAK).
*   `Command.ErrorCode.Fail.Downlaod.CMON_FILE`: Failed to download the CMON file.
*   `Command.ErrorCode.Fail.Downlaod.BTF`: Failed to start SysAK because the BTF file is not found.
*   `Command.ErrorCode.Fail.Start.SYSAK`: Failed to start SysAK due to an unknown error.', example='Command.ErrorCode.Fail.Downlaod.REGIN_ID'),
      osMonitorStatus?: string(name='OsMonitorStatus', description='The status of SysOM. Valid values:

*   installing: SysOM is being installed.
*   running: SysOM is running.
*   stopped: SysOM is stopped.
*   uninstalling: SysOM is being uninstalled.', example='running'),
      osMonitorVersion?: string(name='OsMonitorVersion', description='The SysOM version.', example='1.3.0-12'),
      status?: string(name='Status', description='The status of the CloudMonitor agent. Valid values:

*   running: The CloudMonitor agent is running.
*   stopped: The CloudMonitor agent is stopped.
*   installing: The CloudMonitor agent is being installed.
*   install_faild: The CloudMonitor agent fails to be installed.
*   abnormal: The CloudMonitor agent is not properly installed.
*   not_installed: The CloudMonitor agent is not installed.', example='running'),
    }
  ](name='NodeStatus')
  }(name='NodeStatusList', description='The host status information.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6F8371DF-AB81-41B8-9E1B-5493B3FF0E4F'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeMonitoringAgentStatusesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringAgentStatusesResponseBody(name='body'),
}

/**
 * @summary Queries the status of the CloudMonitor agent.
 *
 * @description This topic describes how to query the status of the CloudMonitor agent that is installed on the `i-hp3dunahluwajv6f****` instance. The result indicates that the CloudMonitor agent is in the `running` state.
 *
 * @param request DescribeMonitoringAgentStatusesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringAgentStatusesResponse
 */
async function describeMonitoringAgentStatusesWithOptions(request: DescribeMonitoringAgentStatusesRequest, runtime: Util.RuntimeOptions): DescribeMonitoringAgentStatusesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hostAvailabilityTaskId)) {
    query['HostAvailabilityTaskId'] = request.hostAvailabilityTaskId;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringAgentStatuses',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the status of the CloudMonitor agent.
 *
 * @description This topic describes how to query the status of the CloudMonitor agent that is installed on the `i-hp3dunahluwajv6f****` instance. The result indicates that the CloudMonitor agent is in the `running` state.
 *
 * @param request DescribeMonitoringAgentStatusesRequest
 * @return DescribeMonitoringAgentStatusesResponse
 */
async function describeMonitoringAgentStatuses(request: DescribeMonitoringAgentStatusesRequest): DescribeMonitoringAgentStatusesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringAgentStatusesWithOptions(request, runtime);
}

model DescribeMonitoringConfigRequest {
  regionId?: string(name='RegionId'),
}

model DescribeMonitoringConfigResponseBody = {
  autoInstall?: boolean(name='AutoInstall', description='Indicates whether the Cloud Monitor agent is automatically installed on existing ECS instances. Valid values:

*   true
*   false', example='false'),
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  enableInstallAgentNewECS?: boolean(name='EnableInstallAgentNewECS', description='Indicates whether the Cloud Monitor agent is automatically installed on new Elastic Compute Service (ECS) instances. Valid values:

*   true
*   false', example='true'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F35654DB-0C9D-4FB3-903F-479BA7663061'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeMonitoringConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeMonitoringConfigResponseBody(name='body'),
}

/**
 * @param request DescribeMonitoringConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeMonitoringConfigResponse
 */
async function describeMonitoringConfigWithOptions(request: DescribeMonitoringConfigRequest, runtime: Util.RuntimeOptions): DescribeMonitoringConfigResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeMonitoringConfig',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeMonitoringConfigRequest
 * @return DescribeMonitoringConfigResponse
 */
async function describeMonitoringConfig(request: DescribeMonitoringConfigRequest): DescribeMonitoringConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeMonitoringConfigWithOptions(request, runtime);
}

model DescribeProductResourceTagKeyListRequest {
  nextToken?: string(name='NextToken', description='The pagination cursor.', example='dbc2826f237e****'),
  regionId?: string(name='RegionId'),
}

model DescribeProductResourceTagKeyListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The request processing has failed due to some unknown error.'),
  nextToken?: string(name='NextToken', description='The pagination cursor. If more entries are to be returned on the next page, a pagination cursor is returned.

>  If the value of this parameter is not null, more entries are to be returned on the next page. You can use the returned pagination cursor as a request parameter to obtain entries on the next page. If the value of this parameter is null, all the entries have been returned.', example='dbc2826f237e****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='945ACAA9-89F2-4A62-8913-076FDEDAA8DB'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
  tagKeys?: {
    tagKey?: [ string ](name='TagKey')
  }(name='TagKeys', description='The keys of tags.'),
}

model DescribeProductResourceTagKeyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProductResourceTagKeyListResponseBody(name='body'),
}

/**
 * @description >  If a tag is attached to multiple cloud resources in the region, the key of the tag is returned only once.
 *
 * @param request DescribeProductResourceTagKeyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProductResourceTagKeyListResponse
 */
async function describeProductResourceTagKeyListWithOptions(request: DescribeProductResourceTagKeyListRequest, runtime: Util.RuntimeOptions): DescribeProductResourceTagKeyListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProductResourceTagKeyList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description >  If a tag is attached to multiple cloud resources in the region, the key of the tag is returned only once.
 *
 * @param request DescribeProductResourceTagKeyListRequest
 * @return DescribeProductResourceTagKeyListResponse
 */
async function describeProductResourceTagKeyList(request: DescribeProductResourceTagKeyListRequest): DescribeProductResourceTagKeyListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProductResourceTagKeyListWithOptions(request, runtime);
}

model DescribeProductsOfActiveMetricRuleRequest {
  regionId?: string(name='RegionId'),
}

model DescribeProductsOfActiveMetricRuleResponseBody = {
  allProductInitMetricRuleList?: {
    allProductInitMetricRule?: [ 
    {
      alertInitConfigList?: {
        alertInitConfig?: [ 
        {
          comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Warn-level alerts.

Valid values:

*   LessThanThreshold: less than the threshold

*   GreaterThanLastWeek: greater than the metric value at the same time last week

*   LessThanOrEqualToThreshold: less than or equal to the threshold

*   NotEqualToThreshold: does not equal to the threshold

*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle

*   GreaterThanYesterday: greater than the metric value at the same time yesterday

*   LessThanYesterday: less than the metric value at the same time yesterday

*   LessThanLastWeek: less than the metric value at the same time last week

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold

*   GreaterThanThreshold: greater than the threshold

*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
          evaluationCount?: string(name='EvaluationCount', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='3'),
          level?: string(name='Level', description='The alert level.

Valid values:

*   INFO

    <!-- -->

    <!-- -->

    <!-- -->

*   WARN

    <!-- -->

    <!-- -->

    <!-- -->

*   CRITICAL

    <!-- -->

    <!-- -->

    <!-- -->', example='CRITICAL'),
          metricName?: string(name='MetricName', description='The metric name. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
          namespace?: string(name='Namespace', description='The namespace of the service. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_rds_dashboard'),
          period?: string(name='Period', description='The aggregation period of monitoring data. Unit: minutes. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='1m'),
          statistics?: string(name='Statistics', description='The method used to calculate metric values that trigger alerts. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
          threshold?: string(name='Threshold', description='The alert threshold.', example='90'),
        }
      ](name='AlertInitConfig')
      }(name='AlertInitConfigList', description='The initial alert rules that are generated after one-click alert is enabled for a service.'),
      product?: string(name='Product', description='The abbreviation of the service name.', example='ecs'),
    }
  ](name='AllProductInitMetricRule')
  }(name='AllProductInitMetricRuleList', description='The information about the services for which one-click alert is enabled.'),
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  datapoints?: string(name='Datapoints', description='The information about the services for which one-click alert is enabled. Services are separated with commas (,). Valid values:

*   ecs: Elastic Compute Service (ECS)
*   rds: ApsaraDB RDS
*   slb: Server Load Balancer (SLB)
*   redis_standard: ApsaraDB for Redis of the standard architecture
*   redis_sharding: ApsaraDB for Redis of the cluster architecture
*   redis_splitrw: ApsaraDB for Redis of the read/write splitting architecture
*   mongodb: ApsaraDB for MongoDB of the replica set architecture
*   mongodb_sharding: ApsaraDB for MongoDB of the sharded cluster architecture
*   hbase: ApsaraDB for HBase
*   elasticsearch: Elasticsearch
*   opensearch: OpenSearch', example='ecs,rds'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F82E6667-7811-4BA0-842F-5B2DC42BBAAD'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
}

model DescribeProductsOfActiveMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProductsOfActiveMetricRuleResponseBody(name='body'),
}

/**
 * @summary Queries the cloud services for which the initiative alert feature is enabled.
 *
 * @param request DescribeProductsOfActiveMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProductsOfActiveMetricRuleResponse
 */
async function describeProductsOfActiveMetricRuleWithOptions(request: DescribeProductsOfActiveMetricRuleRequest, runtime: Util.RuntimeOptions): DescribeProductsOfActiveMetricRuleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeProductsOfActiveMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the cloud services for which the initiative alert feature is enabled.
 *
 * @param request DescribeProductsOfActiveMetricRuleRequest
 * @return DescribeProductsOfActiveMetricRuleResponse
 */
async function describeProductsOfActiveMetricRule(request: DescribeProductsOfActiveMetricRuleRequest): DescribeProductsOfActiveMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProductsOfActiveMetricRuleWithOptions(request, runtime);
}

model DescribeProjectMetaRequest {
  labels?: string(name='Labels', description='The tags. Tags are used to filter services.

You can filter services only by the tag whose `name` is `product`. Example: {"name":"product","value":"ECS"}.

> We recommend that you do not use the special tags in the CloudMonitor console.', example='[{"name":"product","value":"ECS"}]'),
  pageNumber?: int32(name='PageNumber', description='The page number.

Valid values: 1 to 100.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.

Valid values: 1 to 10000.

Default value: 30.

> The value of this parameter is not limited. You can view a large number of entries per page.', example='30'),
}

model DescribeProjectMetaResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  pageNumber?: string(name='PageNumber', description='The page number.', example='1'),
  pageSize?: string(name='PageSize', description='The number of entries per page.', example='5'),
  requestId?: string(name='RequestId', description='The request ID.', example='4C2061B2-3B1B-43BF-A4A4-C53426F479C0'),
  resources?: {
    resource?: [ 
    {
      description?: string(name='Description', description='The description.', example='CDN'),
      labels?: string(name='Labels', description='The tags. Tags are used to filter services.

Tags are returned in the following format: `[{"name":"Tag key","value":"Tag value"}, {"name":"Tag key","value":"Tag value"}]`. The following tags are commonly used:

*   alertUnit: the unit of the metric value in alerts. If the unit is small, the original metric value may be too large. In this case, you can use the `alertUnit` tag to specify an appropriate unit. This tag is used in CloudMonitor.
*   minAlertPeriod: the minimum time interval to report a new alert. The interval at which monitoring data is reported. The value is usually 1 minute.
*   metricCategory: the service specification. Example: kvstore_sharding. Some Alibaba Cloud services have multiple specifications that are defined in the same namespace. This parameter is used to identify the specifications.
*   is_alarm: indicates whether an alert rule can be configured. We recommend that you do not use the special tags in the CloudMonitor console.', example='[{"groupFlag":true}]'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service. Format: `acs_Service name abbreviation`. For more information about namespaces, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_cdn'),
    }
  ](name='Resource')
  }(name='Resources', description='The details of the cloud service.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: true: The request was successful. false: The request failed.', example='true'),
  total?: string(name='Total', description='The total number of entries returned.', example='12'),
}

model DescribeProjectMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeProjectMetaResponseBody(name='body'),
}

/**
 * @summary Queries the information about monitored services in CloudMonitor.
 *
 * @description The information obtained by this operation includes the service description, namespace, and tags.
 *
 * @param request DescribeProjectMetaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeProjectMetaResponse
 */
async function describeProjectMetaWithOptions(request: DescribeProjectMetaRequest, runtime: Util.RuntimeOptions): DescribeProjectMetaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeProjectMeta',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the information about monitored services in CloudMonitor.
 *
 * @description The information obtained by this operation includes the service description, namespace, and tags.
 *
 * @param request DescribeProjectMetaRequest
 * @return DescribeProjectMetaResponse
 */
async function describeProjectMeta(request: DescribeProjectMetaRequest): DescribeProjectMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeProjectMetaWithOptions(request, runtime);
}

model DescribeSiteMonitorAttributeRequest {
  includeAlert?: boolean(name='IncludeAlert', description='Specifies whether to return the information of the alert rules that are configured for the site monitoring task. Valid values:

*   true: The system returns the information of the alert rules that are configured for the site monitoring task.
*   false (default): The system does not return the information of the alert rules that are configured for the site monitoring task.', example='false'),
  regionId?: string(name='RegionId'),
  taskId?: string(name='TaskId', description='The ID of the site monitoring task.

This parameter is required.', example='cc641dff-c19d-45f3-ad0a-818a0c4f****'),
}

model DescribeSiteMonitorAttributeResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  metricRules?: {
    metricRule?: [ 
    {
      actionEnable?: string(name='ActionEnable', description='Indicates whether the alert rule is enabled. Valid values:

*   true: The alert rule is enabled.
*   false: The alert rule is disabled.', example='true'),
      alarmActions?: string(name='AlarmActions', description='The alert contact group to which alert notifications are sent.', example='CloudMonitor'),
      comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold in the alert rule. Valid values:

*   `>=`
*   `>`
*   `<=`
*   `<`
*   `=`
*   `!=`
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanYesterday'),
      dimensions?: string(name='Dimensions', description='The dimension of the alert rule.', example='[{"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****" }]'),
      evaluationCount?: string(name='EvaluationCount', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered.', example='3'),
      expression?: string(name='Expression', description='The expression that is used to trigger alerts.', example='$Availability=30'),
      level?: string(name='Level', description='The alert severity. Valid values:

*   1: critical
*   2: warning
*   3: information', example='2'),
      metricName?: string(name='MetricName', description='The metric name.', example='Availability'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.

The value is in the following format: acs_service name.', example='acs_networkmonitor'),
      okActions?: string(name='OkActions', description='The alert contact group that receives alert notifications.', example='[ "CloudMonitor"]'),
      period?: string(name='Period', description='The time interval. The value is the same as the interval at which metric data is reported. Unit: seconds.

>  If you specify a statistical period for the alert rule, data is queried based on the statistical period.', example='15s'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='bf071ae_7b7aec3817b0fdf****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.', example='rule1'),
      stateValue?: string(name='StateValue', description='The alert status. Valid values:

*   OK: The alert rule has no active alerts.
*   ALARM: The alert rule has active alerts.', example='OK'),
      statistics?: string(name='Statistics', description='The statistical method of the alert rule. Valid values:

*   Availability: the percentage of available detection points
*   AvailableNumber: the number of available detection points
*   ErrorCodeMaximum: a status code for an alert
*   ErrorCodeMinimum: all status codes for a set of alerts
*   Average: response time', example='Availability'),
      threshold?: string(name='Threshold', description='The alert threshold.', example='30'),
    }
  ](name='MetricRule')
  }(name='MetricRules', description='The information of the alert rules that are configured for the site monitoring task.'),
  requestId?: string(name='RequestId', description='The request ID.', example='D17DF650-7EBD-54D0-903A-1D4E624D7402'),
  siteMonitors?: {
    address?: string(name='Address', description='The URL that is monitored by the site monitoring task.', example='https://aliyun.com'),
    agentGroup?: string(name='AgentGroup', example='PC'),
    customSchedule?: {
      days?: {
        days?: [ int32 ](name='days')
      }(name='days'),
      endHour?: int32(name='end_hour', example='18'),
      startHour?: int32(name='start_hour', example='8'),
      timeZone?: string(name='time_zone', example='local'),
    }(name='CustomSchedule'),
    interval?: string(name='Interval', description='The interval at which the site monitoring task is executed. Unit: minutes. Valid values: 1, 5, 15, 30, and 60.', example='1'),
    ispCities?: {
      ispCity?: [ 
      {
        city?: string(name='City', description='The city ID.', example='738'),
        cityName?: string(name='CityName', description='The city name.'),
        isp?: string(name='Isp', description='The carrier ID.', example='465'),
        ispName?: string(name='IspName', description='The carrier name.'),
        type?: string(name='Type', description='探测点网络类型。取值：
IDC: IDC机房
LASTMILE: 网民家宽
MOBILE: 移动蜂窝网', example='IDC'),
      }
    ](name='IspCity')
    }(name='IspCities', description='The information of detection points. The information includes the carriers that provide the detection points and the cities where the detection points reside.'),
    optionJson?: {
      assertions?: {
        assertions?: [ 
        {
          operator?: string(name='operator', example='lessThan'),
          property?: string(name='property', example='json path'),
          target?: string(name='target', example='0'),
          type?: string(name='type', example='response_time'),
        }
      ](name='assertions')
      }(name='assertions'),
      attempts?: long(name='attempts', description='The number of retries after a DNS failure occurred.', example='3'),
      authentication?: int32(name='authentication', description='Indicates whether the security authentication feature is enabled. Valid values:

*   0: The feature is disabled.
*   1: The feature is enabled.', example='1'),
      blockedUrlList?: {
        blockedUrlList?: [ string ](name='blocked_url_list')
      }(name='blocked_url_list'),
      browserHeaders?: {
        browserHeaders?: [  map[string]any ](name='browser_headers')
      }(name='browser_headers'),
      browserHosts?: {
        browserHosts?: [ string ](name='browser_hosts')
      }(name='browser_hosts'),
      browserInfo?: {
        browserInfo?: [ 
        {
          browser?: string(name='browser', example='Chrome'),
          device?: string(name='device', example='laptop'),
        }
      ](name='browser_info')
      }(name='browser_info'),
      browserInsecure?: boolean(name='browser_insecure', example='false'),
      browserTaskVersion?: string(name='browser_task_version', example='1'),
      cookie?: string(name='cookie', description='The cookie of the HTTP request.', example='lang=en'),
      diagnosisMtr?: boolean(name='diagnosis_mtr', example='false'),
      diagnosisPing?: boolean(name='diagnosis_ping', example='false'),
      dnsHijackWhitelist?: string(name='dns_hijack_whitelist', example='www.taobao.com:www.taobao.com.danuoyi.tbcache.com'),
      dnsMatchRule?: string(name='dns_match_rule', description='The relationship between the list of expected aliases or IP addresses and the list of DNS results. Valid values:

*   IN_DNS: The list of expected values is a subset of the list of DNS results.
*   DNS_IN: The list of DNS results is a subset of the list of expected values.
*   EQUAL: The list of DNS results is the same as the list of expected values.
*   ANY: The list of DNS results intersects with the list of expected values.', example='IN_DNS'),
      dnsServer?: string(name='dns_server', description='The IP address of the DNS server.

>  This parameter is returned only if the TaskType parameter is set to DNS.', example='192.168.XX.XX'),
      dnsType?: string(name='dns_type', description='The type of the DNS record. This parameter is returned only if the TaskType parameter is set to DNS. Valid values:

*   A (default): a record that specifies an IP address related to the specified host name or domain name.
*   CNAME: a record that maps multiple domain names to a domain name.
*   NS: a record that specifies a DNS server used to parse domain names.
*   MX: a record that links domain names to the address of a mail server.
*   TXT: a record that stores the text information of host name or domain names. The text must be 1 to 512 bytes in length. The TXT record serves as a Sender Policy Framework (SPF) record to fight against spam.', example='A'),
      emptyMessage?: boolean(name='empty_message', example='false'),
      expectExistString?: {
        expectExistString?: [ string ](name='expect_exist_string')
      }(name='expect_exist_string'),
      expectNonExistString?: {
        expectNonExistString?: [ string ](name='expect_non_exist_string')
      }(name='expect_non_exist_string'),
      expectValue?: string(name='expect_value', description='The domain name or alias to be parsed.

>  This parameter is returned only if the TaskType parameter is set to DNS.', example='dns_server'),
      failureRate?: float(name='failure_rate', description='The packet loss rate.

>  This parameter is returned only if the TaskType parameter is set to PING.', example='0.4'),
      header?: string(name='header', description='The header of the HTTP request.', example='testKey:testValue'),
      hostBinding?: string(name='host_binding'),
      hostBindingType?: int32(name='host_binding_type'),
      httpMethod?: string(name='http_method', description='The HTTP request method. Valid values:

*   get
*   post
*   head', example='get'),
      ipNetwork?: string(name='ip_network', description='ip_network indicates the network type of the task. Valid values: v4, v6, and auto. Default value: v4.', example='v4'),
      isBase64Encode?: string(name='isBase64Encode', example='true'),
      matchRule?: int32(name='match_rule', description='Indicates whether the alert rule is included. Valid values:

*   0: The alert rule is included.
*   1: The alert rule is excluded.', example='1'),
      minTlsVersion?: string(name='min_tls_version', example='tlsv1.2'),
      password?: string(name='password', description='The password of the SMTP, POP3, or FTP protocol.', example='123****'),
      pingNum?: int32(name='ping_num', description='The heartbeat of the PING protocol.', example='29'),
      pingPort?: int32(name='ping_port', example='80'),
      pingType?: string(name='ping_type', description='The PING protocol type. Valid values:

*   icmp
*   tcp
*   udp', example='icmp,tcp,udp'),
      port?: int32(name='port', description='The port number of the TCP, UDP, SMTP, or POP3 protocol.', example='110'),
      protocol?: string(name='protocol', description='The protocol that is used to send the request.', example='TCP'),
      quicEnabled?: boolean(name='quic_enabled', description='Indicates whether the Quick UDP Internet Connections (QUIC) protocol is used for browser detection. Valid values: true false Default value: false.', example='true'),
      quicTarget?: {
        quicTarget?: [ string ](name='quic_target')
      }(name='quic_target', description='The sites for which the QUIC protocol is forcibly used.'),
      requestContent?: string(name='request_content', description='The content of the HTTP request.', example='aa=bb'),
      requestFormat?: string(name='request_format', description='The format of the HTTP request. Valid values:

*   hex: hexadecimal
*   txt: text', example='txt'),
      responseContent?: string(name='response_content', description='The response to the HTTP request.', example='txt'),
      responseFormat?: string(name='response_format', description='The format of the HTTP response. Valid values:

*   hex: hexadecimal
*   txt: text', example='txt'),
      retryDelay?: int32(name='retry_delay', example='0'),
      screenShot?: boolean(name='screen_shot', description='是否开启页面截图', example='false'),
      scrollEnd?: boolean(name='scroll_end'),
      strictMode?: boolean(name='strict_mode', example='false'),
      timeOut?: long(name='time_out', description='The timeout period. Unit: milliseconds.', example='3'),
      trafficHijackElementBlacklist?: {
        trafficHijackElementBlacklist?: [ string ](name='traffic_hijack_element_blacklist')
      }(name='traffic_hijack_element_blacklist'),
      trafficHijackElementCount?: int32(name='traffic_hijack_element_count', example='0'),
      trafficHijackElementWhitelist?: {
        trafficHijackElementWhitelist?: [ string ](name='traffic_hijack_element_whitelist')
      }(name='traffic_hijack_element_whitelist'),
      username?: string(name='username', description='The username of the FTP, SMTP, or POP3 protocol.', example='testUser'),
      waitTimeAfterCompletion?: int32(name='waitTime_after_completion', example='3'),
    }(name='OptionJson', description='The extended options of the site monitoring task. The options vary based on the specified protocol. For more information, see [CreateSiteMonitor](https://help.aliyun.com/document_detail/115048.html).'),
    taskId?: string(name='TaskId', description='The ID of the site monitoring task.', example='cc641dff-c19d-45f3-ad0a-818a0c4f****'),
    taskName?: string(name='TaskName', description='The name of the site monitoring task.', example='test123'),
    taskState?: string(name='TaskState', description='The status of the site monitoring task. Valid values:

*   1: The task is enabled.
*   2: The task is disabled.', example='1'),
    taskType?: string(name='TaskType', description='The protocol that is used by the site monitoring task. Valid values: HTTP, HTTPS, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.', example='HTTP'),
    vpcConfig?: {
      region?: string(name='Region', description='内网拨测任务的目标站点所在地域。', example='cn-beijing'),
      securityGroupId?: string(name='SecurityGroupId', example='sg-xxxxxx'),
      vpcId?: string(name='VpcId', example='vpc-xxxxxx'),
      vswitchId?: string(name='VswitchId', example='vsw-xxxxxx'),
    }(name='VpcConfig'),
  }(name='SiteMonitors', description='The details of the site monitoring task.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeSiteMonitorAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a site monitoring task.
 *
 * @description This topic provides an example on how to query the details of a site monitoring task whose ID is `cc641dff-c19d-45f3-ad0a-818a0c4f****`. The returned result indicates that the task name is `test123`, the URL that is monitored by the task is `https://aliyun.com`, and the name of the carrier is `Alibaba`.
 *
 * @param request DescribeSiteMonitorAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorAttributeResponse
 */
async function describeSiteMonitorAttributeWithOptions(request: DescribeSiteMonitorAttributeRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.includeAlert)) {
    query['IncludeAlert'] = request.includeAlert;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a site monitoring task.
 *
 * @description This topic provides an example on how to query the details of a site monitoring task whose ID is `cc641dff-c19d-45f3-ad0a-818a0c4f****`. The returned result indicates that the task name is `test123`, the URL that is monitored by the task is `https://aliyun.com`, and the name of the carrier is `Alibaba`.
 *
 * @param request DescribeSiteMonitorAttributeRequest
 * @return DescribeSiteMonitorAttributeResponse
 */
async function describeSiteMonitorAttribute(request: DescribeSiteMonitorAttributeRequest): DescribeSiteMonitorAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorAttributeWithOptions(request, runtime);
}

model DescribeSiteMonitorDataRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 UTC on Thursday, January 1, 1970.
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format.', example='1551581437000'),
  length?: int32(name='Length', description='The number of data points to return.', example='1000'),
  metricName?: string(name='MetricName', description='The metric name. Valid values:

*   Availability
*   ResponseTime

This parameter is required.', example='Availability'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='49f7b317-7645-4cc9-94fd-ea42e5220930ea42e5220930ea42e522****'),
  period?: string(name='Period', description='The statistical period. The value is an integral multiple of 60. Unit: seconds.

>  The default value equals the minimum interval at which detection requests are sent to the monitored address.', example='60'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The start of the time range to query. The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 UTC on Thursday, January 1, 1970.
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format.', example='1551579637000'),
  taskId?: string(name='TaskId', description='The job ID.

This parameter is required.', example='49f7b317-7645-4cc9-94fd-ea42e522****'),
  type?: string(name='Type', description='The type of the monitored object whose monitoring data is to be queried. Valid values:

*   metric
*   event', example='metric'),
}

model DescribeSiteMonitorDataResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: string(name='Data', description='The monitoring data.', example='[{"Maximum":247,"Mimimum":61,"Average":154,"userId":"127067667954****","taskId":"49f7b317-7645-4cc9-94fd-ea42e522****","timestamp":1551581760000}]'),
  message?: string(name='Message', description='The returned message.', example='Successful'),
  nextToken?: string(name='NextToken', description='The pagination token.', example='ea42e5220930ea42e522****'),
  requestId?: string(name='RequestId', description='The request ID.', example='3febb181-0d98-4af9-8b04-7faf36b048b9'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values: true: The request was successful. false: The request failed.', example='true'),
}

model DescribeSiteMonitorDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorDataResponseBody(name='body'),
}

/**
 * @summary Queries the fine-grained monitoring data of a site monitoring task.
 *
 * @param request DescribeSiteMonitorDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorDataResponse
 */
async function describeSiteMonitorDataWithOptions(request: DescribeSiteMonitorDataRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorData',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the fine-grained monitoring data of a site monitoring task.
 *
 * @param request DescribeSiteMonitorDataRequest
 * @return DescribeSiteMonitorDataResponse
 */
async function describeSiteMonitorData(request: DescribeSiteMonitorDataRequest): DescribeSiteMonitorDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorDataWithOptions(request, runtime);
}

model DescribeSiteMonitorISPCityListRequest {
  city?: string(name='City', description='The name or ID of the city.

> City names support fuzzy match.'),
  IPV4?: boolean(name='IPV4', description='Specifies whether to query IPv4 probes. Valid values:

*   true (default): IPv4 probes are queried.
*   false: IPv4 probes are not queried.', example='true'),
  IPV6?: boolean(name='IPV6', description='Specifies whether to query IPv6 probes. Valid values:

*   true (default): IPv6 probes are queried.
*   false: IPv6 probes are not queried.', example='true'),
  isp?: string(name='Isp', description='The name or ID of the carrier.

> Carrier names support fuzzy match.'),
  regionId?: string(name='RegionId'),
  viewAll?: boolean(name='ViewAll', description='Specifies whether to return all detection points. Valid values:

*   true (default): returns all detection points.
*   false: returns only available detection points.', example='true'),
}

model DescribeSiteMonitorISPCityListResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  ispCityList?: {
    ispCity?: [ 
    {
      area_en?: string(name='Area.en'),
      area_zh_cN?: string(name='Area.zh_CN'),
      city?: string(name='City', description='The city ID.', example='4'),
      cityName_en?: string(name='CityName.en'),
      cityName_zh_cN?: string(name='CityName.zh_CN'),
      country?: string(name='Country', description='The country name.

> This parameter is valid only on the China site (aliyun.com).', example='629'),
      country_en?: string(name='Country.en'),
      country_zh_cN?: string(name='Country.zh_CN'),
      IPPool?: {
        IPPool?: [ string ](name='IPPool')
      }(name='IPPool', description='The IP address pool.'),
      IPV4ProbeCount?: string(name='IPV4ProbeCount', description='The number of IPv4 probes.', example='4'),
      IPV6ProbeCount?: string(name='IPV6ProbeCount', description='The number of IPv6 probes.', example='3'),
      isp?: string(name='Isp', description='The carrier ID.', example='232'),
      ispName_en?: string(name='IspName.en'),
      ispName_zh_cN?: string(name='IspName.zh_CN'),
      region?: string(name='Region', description='The province name.', example='264'),
      region_en?: string(name='Region.en'),
      region_zh_cN?: string(name='Region.zh_CN'),
    }
  ](name='IspCity')
  }(name='IspCityList', description='The queried detection points.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='B35D7D84-547B-4E61-B909-48A1F8A0C756'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeSiteMonitorISPCityListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorISPCityListResponseBody(name='body'),
}

/**
 * @summary Queries the detection points that are provided by carriers.
 *
 * @description This topic provides an example on how to query the detection points that are provided by China Unicom in Guiyang.
 *
 * @param request DescribeSiteMonitorISPCityListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorISPCityListResponse
 */
async function describeSiteMonitorISPCityListWithOptions(request: DescribeSiteMonitorISPCityListRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorISPCityListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.IPV4)) {
    query['IPV4'] = request.IPV4;
  }
  if (!Util.isUnset(request.IPV6)) {
    query['IPV6'] = request.IPV6;
  }
  if (!Util.isUnset(request.isp)) {
    query['Isp'] = request.isp;
  }
  if (!Util.isUnset(request.viewAll)) {
    query['ViewAll'] = request.viewAll;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorISPCityList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the detection points that are provided by carriers.
 *
 * @description This topic provides an example on how to query the detection points that are provided by China Unicom in Guiyang.
 *
 * @param request DescribeSiteMonitorISPCityListRequest
 * @return DescribeSiteMonitorISPCityListResponse
 */
async function describeSiteMonitorISPCityList(request: DescribeSiteMonitorISPCityListRequest): DescribeSiteMonitorISPCityListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorISPCityListWithOptions(request, runtime);
}

model DescribeSiteMonitorListRequest {
  keyword?: string(name='Keyword', description='The keyword to be matched.

>  You can search for tasks by name or address. Fuzzy search is supported.', example='site'),
  page?: int32(name='Page', description='The page number. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page. Default value: 10.', example='10'),
  regionId?: string(name='RegionId'),
  taskId?: string(name='TaskId', description='The ID of the site monitoring task.', example='a1ecd34a-8157-44d9-b060-14950837****'),
  taskState?: string(name='TaskState', description='The task status. Valid values:

*   1: The task is enabled.
*   2: The task is disabled.', example='1'),
  taskType?: string(name='TaskType', description='The protocol that is used by the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.', example='HTTP'),
}

model DescribeSiteMonitorListResponseBody = {
  code?: string(name='Code', description='The status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  pageNumber?: int32(name='PageNumber', description='The page number.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries per page.', example='10'),
  requestId?: string(name='RequestId', description='The request ID.', example='A80DB41C-AF6C-50E1-ADB5-66DCBA3D266B'),
  siteMonitors?: {
    siteMonitor?: [ 
    {
      address?: string(name='Address', description='The URL or IP address that is monitored by the site monitoring task.', example='https://aliyun.com'),
      agentGroup?: string(name='AgentGroup', description='The detection point type. Valid values:

*   PC
*   MOBILE', example='PC'),
      createTime?: string(name='CreateTime', description='The time when the site monitoring task was created.', example='2021-11-01 11:05:18'),
      interval?: string(name='Interval', description='The interval at which detection requests are sent. Unit: minutes.', example='1'),
      optionsJson?: {
        acceptableResponseCode?: string(name='acceptable_response_code', description='The acceptable status code.

>  We recommend that you configure assertions.', example='400'),
        assertions?: {
          assertions?: [ 
          {
            operator?: string(name='operator', description='The comparison operator of the assertion. Valid values:

*   contains: contains
*   doesNotContain: does not contain
*   matches: matches regular expressions
*   doesNotMatch: does not match regular expressions
*   is: equal to a numeric value or matches a character
*   isNot: not equal to
*   lessThan: less than
*   moreThan: greater than', example='lessThan'),
            property?: string(name='property', description='The parsing path of the assertion.

*   If the assertion type is `body_json`, the path is `json path`.
*   If the assertion type is `body_xml`, the path is `xml path`.', example='json path'),
            target?: string(name='target', description='The numeric value or character used for matching.', example='1000'),
            type?: string(name='type', description='The assertion type. Valid values:

*   response_time: checks whether the response time meets expectations.
*   status_code: checks whether the HTTP status code meets expectations.
*   header: checks whether the fields in the response header meet expectations.
*   body_text: checks whether the content in the response body meets expectations by using text matching.
*   body_json: checks whether the content in the response body meets expectations by using JSON parsing (JSONPath).
*   body_xml: checks whether the content in the response body meets expectations by using XML parsing (XPath).', example='response_time'),
          }
        ](name='assertions')
        }(name='assertions', description='The assertions.'),
        attempts?: long(name='attempts', description='The number of retries after a DNS failure occurred.', example='3'),
        authentication?: int32(name='authentication', description='Indicates whether the security authentication feature is enabled. Valid values:

*   0: The feature is enabled.
*   1: The feature is disabled.', example='1'),
        certVerify?: boolean(name='cert_verify', description='Indicates whether the certificate is verified. Valid values:

*   false (default): The certificate is not verified.
*   true: The certificate is verified.', example='false'),
        cookie?: string(name='cookie', description='The cookie of the HTTP request.', example='lang=en'),
        diagnosisMtr?: boolean(name='diagnosis_mtr', description='Indicates whether MTR is automatically used to diagnose network issues if a task fails. Valid values:

*   false (default): MTR is not automatically used to diagnose network issues if a task fails.
*   true: MTR is automatically used to diagnose network issues if a task fails.', example='false'),
        diagnosisPing?: boolean(name='diagnosis_ping', description='Indicates whether ping requests are automatically sent to detect network latency if a detection task fails. Valid values:

*   false (default): Ping requests are not automatically sent to detect network latency if a detection task fails.
*   true: Ping requests are automatically sent to detect network latency if a detection task fails.', example='false'),
        dnsMatchRule?: string(name='dns_match_rule', description='The relationship between the list of expected aliases or IP addresses and the list of DNS results. Valid values:

*   IN_DNS: The list of expected values is a subset of the list of DNS results.
*   DNS_IN: The list of DNS results is a subset of the list of expected values.
*   EQUAL: The list of DNS results is the same as the list of expected values.
*   ANY: The list of DNS results intersects with the list of expected values.', example='IN_DNS'),
        dnsServer?: string(name='dns_server', description='The domain name or IP address of the DNS server.', example='192.168.XX.XX'),
        dnsType?: string(name='dns_type', description='The type of the DNS record. This parameter is returned only if the TaskType parameter is set to DNS. Valid values:

*   A (default): a record that specifies an IP address related to the specified host name or domain name.
*   CNAME: a record that maps multiple domain names to a domain name.
*   NS: a record that specifies a DNS server used to parse domain names.
*   MX: a record that links domain names to the address of a mail server.
*   TXT: a record that stores the text information of host name or domain names. The text must be 1 to 512 bytes in length. The TXT record serves as a Sender Policy Framework (SPF) record to fight against spam.
*   AAAA: a record that maps a domain name to the relevant IPv6 address.', example='A'),
        enableOperatorDns?: boolean(name='enable_operator_dns', description='Indicates whether the DNS server of the carrier is used.

*   true (default): The DNS server of the carrier is used.
*   false: The DNS server of the carrier is not used. The default DNS server or the specified DNS server is used.', example='true'),
        failureRate?: float(name='failure_rate', description='The packet loss rate.

>  This parameter is returned only if the TaskType parameter is set to PING.', example='0.5'),
        header?: string(name='header', description='The header of the HTTP request. An HTTP header is a key-value pair in which the key and the value are separated by a colon (:). The format is `key1:value1`. Each HTTP header occupies a line.', example='testKey:testValue'),
        httpMethod?: string(name='http_method', description='The HTTP request method. Valid values:

*   get
*   post
*   head', example='get'),
        isBase64Encode?: string(name='isBase64Encode', description='Indicates whether the password is decoded by using the Base64 algorithm. Valid values:

*   true: The password is decoded by using the Base64 algorithm.
*   false (default): The password is not decoded by using the Base64 algorithm.', example='false'),
        matchRule?: int32(name='match_rule', description='Indicates whether the alert rule is included. Valid values:

*   0: The alert rule is included.
*   1: The alert rule is not included.', example='0'),
        password?: string(name='password', description='The password of the SMTP, POP3, or FTP protocol.', example='123****'),
        pingNum?: int32(name='ping_num', description='The number of hops for the PING protocol.', example='20'),
        port?: int32(name='port', description='The port number of the TCP, UDP, SMTP, or POP3 protocol.', example='80'),
        protocol?: string(name='protocol', description='The protocol type of DNS detection. Valid values:

*   udp (default)
*   tcp
*   tcp-tls', example='udp'),
        proxyProtocol?: boolean(name='proxy_protocol', description='Indicates whether the PROXY protocol is enabled. Valid values:

*   false (default): The PROXY protocol is disabled.
*   true: The PROXY protocol is enabled.', example='false'),
        requestContent?: string(name='request_content', description='The content of the HTTP request.', example='cf0f85'),
        requestFormat?: string(name='request_format', description='The format of the HTTP request. Valid values:

*   hex: hexadecimal
*   txt: text', example='hex'),
        responseContent?: string(name='response_content', description='The response to the HTTP request.

*   Hexadecimal format: If the request content is a byte string and cannot be represented in printable characters, you can convert the byte string to printable characters in the hexadecimal format. If you convert the byte string to printable characters in the hexadecimal format, one byte is converted to two hexadecimal characters. For example, (byte)1 is converted to `01` and (byte)27 is converted to `1B`. If the request content is a binary array in the Java format, for example, `{(byte)1, (byte)27}`, you can convert the binary array to `011b` or `011B`. Hexadecimal characters are not case-sensitive in site monitoring tasks. You can enter `011B` in the request content and set the request_format parameter to hex.
*   Text format: Common text refers to strings that consist of printable characters.', example='cf0f85'),
        responseFormat?: string(name='response_format', description='The format of the HTTP response. Valid values:

*   hex: hexadecimal
*   txt: text', example='hex'),
        retryDelay?: int32(name='retry_delay', description='The number of times a failed detection request is retried.', example='1'),
        timeOut?: long(name='time_out', description='The timeout period. Unit: milliseconds.', example='3000'),
        unfollowRedirect?: boolean(name='unfollow_redirect', description='Indicates whether redirects are followed if the status code 301 or 302 is returned. Valid values:

*   true: Redirects are not followed.
*   false (default): Redirects are followed.', example='false'),
        username?: string(name='username', description='The username of the FTP, SMTP, or POP3 protocol.', example='testUser'),
      }(name='OptionsJson', description='The extended options of the site monitoring task. The options vary based on the specified protocol. For more information, see [CreateSiteMonitor](https://help.aliyun.com/document_detail/115048.html).'),
      taskId?: string(name='TaskId', description='The ID of the site monitoring task.', example='f5783760-1b39-4b6b-80e8-453d962a****'),
      taskName?: string(name='TaskName', description='The name of the site monitoring task.'),
      taskState?: string(name='TaskState', description='The task status. Valid values:

*   1: The task is enabled.
*   2: The task is disabled.', example='1'),
      taskType?: string(name='TaskType', description='The protocol that is used by the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.', example='TCP'),
      updateTime?: string(name='UpdateTime', description='The time when the site monitoring task was updated.', example='2022-03-08 17:14:31'),
    }
  ](name='SiteMonitor')
  }(name='SiteMonitors', description='The site monitoring tasks that are returned.'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model DescribeSiteMonitorListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorListResponseBody(name='body'),
}

/**
 * @summary Queries site monitoring tasks.
 *
 * @description This topic provides an example on how to query all the site monitoring tasks of your Alibaba Cloud account. In this example, the returned result indicates that the Alibaba Cloud account has one site monitoring task named `HanZhou_ECS2`.
 *
 * @param request DescribeSiteMonitorListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorListResponse
 */
async function describeSiteMonitorListWithOptions(request: DescribeSiteMonitorListRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.page)) {
    query['Page'] = request.page;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskState)) {
    query['TaskState'] = request.taskState;
  }
  if (!Util.isUnset(request.taskType)) {
    query['TaskType'] = request.taskType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries site monitoring tasks.
 *
 * @description This topic provides an example on how to query all the site monitoring tasks of your Alibaba Cloud account. In this example, the returned result indicates that the Alibaba Cloud account has one site monitoring task named `HanZhou_ECS2`.
 *
 * @param request DescribeSiteMonitorListRequest
 * @return DescribeSiteMonitorListResponse
 */
async function describeSiteMonitorList(request: DescribeSiteMonitorListRequest): DescribeSiteMonitorListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorListWithOptions(request, runtime);
}

model DescribeSiteMonitorLogRequest {
  browser?: string(name='Browser', example='Chrome'),
  browserInfo?: string(name='BrowserInfo'),
  city?: string(name='City', description='The city identification code.', example='546'),
  device?: string(name='Device', example='laptop'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Valid values:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format

>  We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='1638422475687'),
  filter?: string(name='Filter', description='The filter condition.

You can specify a simple expression, for example, `TotalTime>100`. In this case, the operation returns only the data for instant test tasks whose total response time exceeds 100 milliseconds.', example='TotalTime>100'),
  isp?: string(name='Isp', description='The carrier identification code.', example='465'),
  length?: int32(name='Length', description='The number of entries to return on each page. Valid values: 1 to 1440.', example='1000'),
  metricName?: string(name='MetricName', description='The name of the metric.

Only the `ProbeLog` metric is supported.', example='ProbeLog'),
  nextToken?: string(name='NextToken', description='The token that is used to initiate the next request if the response of the current request is truncated. You can use the token to initiate another request and obtain the remaining records.``', example='IWBjqMYSy0is7zSMGu16****'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The start of the time range to query. The following formats are supported:

*   UNIX timestamp: the number of milliseconds that have elapsed since 00:00:00 Thursday, January 1, 1970
*   UTC time: the UTC time that follows the YYYY-MM-DDThh:mm:ssZ format

> 

*   The specified time range includes the end time and excludes the start time. The start time must be earlier than the end time.\\\\
    We recommend that you use UNIX timestamps to prevent time zone-related issues.', example='1638422474389'),
  taskIds?: string(name='TaskIds', description='The IDs of the instant test tasks. Separate multiple task IDs with commas (,).

This parameter is required.', example='afa5c3ce-f944-4363-9edb-ce919a29****'),
}

model DescribeSiteMonitorLogResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

**

**Description** The status code 200 indicates that the request was successful.', example='200'),
  data?: string(name='Data', description='The logs of the instant test tasks.', example='[{\\\\\\\\"redirectCount\\\\\\\\":0.0,\\\\\\\\"SSLConnectTime\\\\\\\\":0.0,\\\\\\\\"pingDetail\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"HTTPConnectTime\\\\\\\\":0.0,\\\\\\\\"isp\\\\\\\\":\\\\\\\\"465\\\\\\\\",\\\\\\\\"errorCode\\\\\\\\":611,\\\\\\\\"ispCN\\\\\\\\":\\\\\\\\"Alibaba\\\\\\\\",\\\\\\\\"resolution\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"areaEN\\\\\\\\":\\\\\\\\"HuaBei\\\\\\\\",\\\\\\\\"taskEndTimestamp\\\\\\\\":1638422475687,\\\\\\\\"targetIspEN\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"TotalTime\\\\\\\\":1.0,\\\\\\\\"taskStartTimestamp\\\\\\\\":1638422474389,\\\\\\\\"countryCN\\\\\\\\":\\\\\\\\"China\\\\\\\\",\\\\\\\\"provinceEN\\\\\\\\":\\\\\\\\"Beijing\\\\\\\\",\\\\\\\\"countryEN\\\\\\\\":\\\\\\\\"China\\\\\\\\",\\\\\\\\"targetCityEN\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"curlConnectTime\\\\\\\\":0.0,\\\\\\\\"ips\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"route\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"tcpConnectTime\\\\\\\\":0.0,\\\\\\\\"cityEN\\\\\\\\":\\\\\\\\"Beijing\\\\\\\\",\\\\\\\\"HTTPDownloadSpeed\\\\\\\\":0.0,\\\\\\\\"HTTPDownloadTime\\\\\\\\":0.0,\\\\\\\\"HTTPResponseCode\\\\\\\\":0.0,\\\\\\\\"areaCN\\\\\\\\":\\\\\\\\"North China\\\\\\\\",\\\\\\\\"city\\\\\\\\":\\\\\\\\"546\\\\\\\\",\\\\\\\\"expection\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"suorceIp\\\\\\\\":\\\\\\\\"192.168.XX.XX \\\\\\\\",\\\\\\\\"ispEN\\\\\\\\":\\\\\\\\"Alibaba\\\\\\\\",\\\\\\\\"HTTPDNSTime\\\\\\\\":1.0,\\\\\\\\"targetIsp\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"curlStarttransferTime\\\\\\\\":0.0,\\\\\\\\"provinceCN\\\\\\\\":\\\\\\\\"Beijing\\\\\\\\",\\\\\\\\"timestamp\\\\\\\\":1638422474000,\\\\\\\\"redirectTime\\\\\\\\":0.0,\\\\\\\\"targetCity\\\\\\\\":\\\\\\\\"\\\\\\\\", \\\\\\\\"expect\\\\\\\\":\\\\\\\\"\\\\\\\\",\\\\\\\\"HTTPDownloadSize\\\\\\\\":0.0,\\\\\\\\"localDns\\\\\\\\":\\\\\\\\"192.168.XX.XX\\\\\\\\",\\\\\\\\"cityCN\\\\\\\\":\\\\\\\\"Beijing\\\\\\\\",\\\\\\\\"taskId\\\\\\\\":\\\\\\\\"afa5c3ce-f944-4363-9edb-ce919a29\\\\*\\\\*\\\\*\\\\*\\\\\\\\"}]'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results.', example='IWBjqMYSy0is7zSMGu16****'),
  requestId?: string(name='RequestId', description='The request ID.', example='67F646FA-ED8A-58C2-B461-451DB52C8B14'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeSiteMonitorLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorLogResponseBody(name='body'),
}

/**
 * @summary Queries the logs of one or more instant test tasks.
 *
 * @description You can create an instant test task only by using the Alibaba Cloud account that you used to enable Network Analysis and Monitoring.
 * This topic provides an example to show how to query the logs of an instant test task whose ID is `afa5c3ce-f944-4363-9edb-ce919a29****`.
 *
 * @param request DescribeSiteMonitorLogRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorLogResponse
 */
async function describeSiteMonitorLogWithOptions(request: DescribeSiteMonitorLogRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.browser)) {
    query['Browser'] = request.browser;
  }
  if (!Util.isUnset(request.browserInfo)) {
    query['BrowserInfo'] = request.browserInfo;
  }
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.device)) {
    query['Device'] = request.device;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.isp)) {
    query['Isp'] = request.isp;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorLog',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the logs of one or more instant test tasks.
 *
 * @description You can create an instant test task only by using the Alibaba Cloud account that you used to enable Network Analysis and Monitoring.
 * This topic provides an example to show how to query the logs of an instant test task whose ID is `afa5c3ce-f944-4363-9edb-ce919a29****`.
 *
 * @param request DescribeSiteMonitorLogRequest
 * @return DescribeSiteMonitorLogResponse
 */
async function describeSiteMonitorLog(request: DescribeSiteMonitorLogRequest): DescribeSiteMonitorLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorLogWithOptions(request, runtime);
}

model DescribeSiteMonitorQuotaRequest {
  regionId?: string(name='RegionId'),
}

model DescribeSiteMonitorQuotaResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: {
    secondMonitor?: boolean(name='SecondMonitor', description='Indicates whether second-level monitoring is enabled. Valid values:

*   true: Second-level monitoring is enabled.
*   false: Second-level monitoring is disabled.', example='false'),
    siteMonitorIdcQuota?: int32(name='SiteMonitorIdcQuota', description='The quota of detection points that are provided by Alibaba Cloud. Five detection points are provided for free.', example='5'),
    siteMonitorOperatorQuotaQuota?: int32(name='SiteMonitorOperatorQuotaQuota', description='The quota of detection points that are not provided by Alibaba Cloud. Default value: 0.', example='0'),
    siteMonitorQuotaTaskUsed?: int32(name='SiteMonitorQuotaTaskUsed', description='The used quota of site monitoring tasks.', example='6'),
    siteMonitorTaskQuota?: int32(name='SiteMonitorTaskQuota', description='The quota of site monitoring tasks.', example='10'),
    siteMonitorVersion?: string(name='SiteMonitorVersion', description='The version of site monitoring. Valid values:

*   V1
*   V2', example='V1'),
  }(name='Data', description='The quota.'),
  message?: string(name='Message', description='The returned message.'),
  requestId?: string(name='RequestId', description='The request ID.', example='26860260-76C6-404E-AB7A-EB98D36A6885'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeSiteMonitorQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorQuotaResponseBody(name='body'),
}

/**
 * @summary Queries the quotas and version of site monitoring.
 *
 * @param request DescribeSiteMonitorQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorQuotaResponse
 */
async function describeSiteMonitorQuotaWithOptions(request: DescribeSiteMonitorQuotaRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorQuotaResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorQuota',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the quotas and version of site monitoring.
 *
 * @param request DescribeSiteMonitorQuotaRequest
 * @return DescribeSiteMonitorQuotaResponse
 */
async function describeSiteMonitorQuota(request: DescribeSiteMonitorQuotaRequest): DescribeSiteMonitorQuotaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorQuotaWithOptions(request, runtime);
}

model DescribeSiteMonitorStatisticsRequest {
  metricName?: string(name='MetricName', description='The metric name. Valid values:

*   Availability
*   ErrorRate
*   ResponseTime

This parameter is required.', example='Availability'),
  regionId?: string(name='RegionId'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

Unit: milliseconds. The default value is 1 hour ahead of the current time.', example='1576142850527'),
  taskId?: string(name='TaskId', description='The ID of the site monitoring task.

For more information about how to obtain the ID of a site monitoring task, see [DescribeSiteMonitorList](https://help.aliyun.com/document_detail/115052.html).

This parameter is required.', example='ef4cdc8b-9dc7-43e7-810e-f950e56c****'),
  timeRange?: string(name='TimeRange', description='The statistical period.

Unit: minutes. Default value: 1440 (one day). Maximum value: 43200 (30 days).', example='1440'),
}

model DescribeSiteMonitorStatisticsResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: string(name='Data', description='The statistics.', example='100'),
  message?: string(name='Message', description='The returned message.', example='Succcessful'),
  requestId?: string(name='RequestId', description='The request ID.', example='3AD2724D-E317-4BFB-B422-D6691D071BE1'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DescribeSiteMonitorStatisticsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSiteMonitorStatisticsResponseBody(name='body'),
}

/**
 * @summary Queries the statistics of a specified metric for a specified site monitoring task.
 *
 * @description This topic provides an example on how to query the statistics of the `Availability` metric for a site monitoring task whose ID is `ef4cdc8b-9dc7-43e7-810e-f950e56c****`. The result indicates that the availability rate of the site is `100%`.
 *
 * @param request DescribeSiteMonitorStatisticsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSiteMonitorStatisticsResponse
 */
async function describeSiteMonitorStatisticsWithOptions(request: DescribeSiteMonitorStatisticsRequest, runtime: Util.RuntimeOptions): DescribeSiteMonitorStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.timeRange)) {
    query['TimeRange'] = request.timeRange;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSiteMonitorStatistics',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the statistics of a specified metric for a specified site monitoring task.
 *
 * @description This topic provides an example on how to query the statistics of the `Availability` metric for a site monitoring task whose ID is `ef4cdc8b-9dc7-43e7-810e-f950e56c****`. The result indicates that the availability rate of the site is `100%`.
 *
 * @param request DescribeSiteMonitorStatisticsRequest
 * @return DescribeSiteMonitorStatisticsResponse
 */
async function describeSiteMonitorStatistics(request: DescribeSiteMonitorStatisticsRequest): DescribeSiteMonitorStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSiteMonitorStatisticsWithOptions(request, runtime);
}

model DescribeSyntheticProbeListRequest {
  city?: string(name='City'),
  idcProbe?: boolean(name='IdcProbe', example='false'),
  ipv4?: boolean(name='Ipv4', example='false'),
  ipv6?: boolean(name='Ipv6', example='false'),
  isp?: string(name='Isp'),
  lmProbe?: boolean(name='LmProbe', example='false'),
  mbProbe?: boolean(name='MbProbe', example='false'),
  regionId?: string(name='RegionId'),
  viewAll?: boolean(name='ViewAll', example='true'),
}

model DescribeSyntheticProbeListResponseBody = {
  code?: string(name='Code', example='200'),
  ispCityList?: [ 
    {
      areaCn?: string(name='AreaCn'),
      areaEn?: string(name='AreaEn', example='Huabei'),
      city?: string(name='City', example='738'),
      cityCn?: string(name='CityCn'),
      cityEn?: string(name='CityEn', example='Beijing'),
      country?: string(name='Country', example='629'),
      countryCn?: string(name='CountryCn'),
      countryEn?: string(name='CountryEn', example='China'),
      idcV4ProbeCount?: int32(name='IdcV4ProbeCount', example='1'),
      idcV6ProbeCount?: int32(name='IdcV6ProbeCount'),
      ipPool?: [ string ](name='IpPool'),
      isp?: string(name='Isp', example='232'),
      ispCn?: string(name='IspCn'),
      ispEn?: string(name='IspEn', example='China-Unicom'),
      lmProbeCount?: int32(name='LmProbeCount', example='1'),
      mbProbeCount?: int32(name='MbProbeCount', example='1'),
      region?: string(name='Region', example='264'),
      regionCn?: string(name='RegionCn'),
      regionEn?: string(name='RegionEn', example='Jiangxi'),
    }
  ](name='IspCityList'),
  message?: string(name='Message', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', example='87170bc7-e28a-4c93-b9bf-90a1dbe84736'),
  success?: string(name='Success', example='true'),
}

model DescribeSyntheticProbeListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSyntheticProbeListResponseBody(name='body'),
}

/**
 * @summary 查询拨测探测节点列表
 *
 * @param request DescribeSyntheticProbeListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSyntheticProbeListResponse
 */
async function describeSyntheticProbeListWithOptions(request: DescribeSyntheticProbeListRequest, runtime: Util.RuntimeOptions): DescribeSyntheticProbeListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.city)) {
    query['City'] = request.city;
  }
  if (!Util.isUnset(request.idcProbe)) {
    query['IdcProbe'] = request.idcProbe;
  }
  if (!Util.isUnset(request.ipv4)) {
    query['Ipv4'] = request.ipv4;
  }
  if (!Util.isUnset(request.ipv6)) {
    query['Ipv6'] = request.ipv6;
  }
  if (!Util.isUnset(request.isp)) {
    query['Isp'] = request.isp;
  }
  if (!Util.isUnset(request.lmProbe)) {
    query['LmProbe'] = request.lmProbe;
  }
  if (!Util.isUnset(request.mbProbe)) {
    query['MbProbe'] = request.mbProbe;
  }
  if (!Util.isUnset(request.viewAll)) {
    query['ViewAll'] = request.viewAll;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSyntheticProbeList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询拨测探测节点列表
 *
 * @param request DescribeSyntheticProbeListRequest
 * @return DescribeSyntheticProbeListResponse
 */
async function describeSyntheticProbeList(request: DescribeSyntheticProbeListRequest): DescribeSyntheticProbeListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSyntheticProbeListWithOptions(request, runtime);
}

model DescribeSystemEventAttributeRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query.

The value must be a UNIX timestamp. It is the number of seconds that have elapsed since 00:00:00 UTC, January 1, 1970.', example='1552221584949'),
  eventType?: string(name='EventType', description='The type of the system event.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the types of system events.', example='Exception'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='12346'),
  level?: string(name='Level', description='The level of the system event. Valid values:

*   CRITICAL: critical
*   WARN: warning
*   INFO: information', example='CRITICAL'),
  name?: string(name='Name', description='The name of the system event.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the names of system events.', example='BucketIngressBandwidth'),
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Valid values: 1 to 100000000.

Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Valid values: 1 to 100.

Default value: 10', example='10'),
  product?: string(name='Product', description='The abbreviation of the service name.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the abbreviations of service names.', example='oss'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are used to search for the system event. Valid values:

*   If you want to search for the system event whose content contains a and b, set the value to `a and b`.
*   If you want to search for the system event whose content contains a or b, set the value to `a or b`.', example='cms'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query.

The value must be a UNIX timestamp. It is the number of seconds that have elapsed since 00:00:00 UTC, January 1, 1970.', example='1552199984949'),
  status?: string(name='Status', description='The status of the system event.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the statuses of system events.', example='normal'),
}

model DescribeSystemEventAttributeResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call is successful.', example='200'),
  message?: string(name='Message', description='The message that is returned. If the call is successful, `success` is returned. If the call fails, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='60912C8D-B340-4253-ADE7-61ACDFD25CFC'),
  success?: string(name='Success', description='Indicates whether the call is successful. Valid values: True: The call is successful. false: The call fails.', example='true'),
  systemEvents?: {
    systemEvent?: [ 
    {
      content?: string(name='Content', description='The details of the event.', example='[{"product":"CloudMonitor","content":"{\\\\"ipGroup\\\\":\\\\"112.126.XX.XX,10.163.XX.XX\\\\",\\\\"tianjimonVersion\\\\":\\\\"1.2.22\\\\"}","groupId":"176,177,178,179,180,692,120812,1663836,96,2028302","time":"1552209568000","resourceId":"acs:ecs:cn-beijing:173651113438****:instance/i-25k35****","level":"CRITICAL","status":"stopped","instanceName":"cmssiteprobebj-6","name":"Agent_Status_Stopped","regionId":"cn-beijing"}]'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
      id?: string(name='Id', description='The event ID.', example='b936efc9-f621-4e8a-a6eb-076be40e****'),
      instanceName?: string(name='InstanceName', description='The instance name.', example='instanceId1'),
      level?: string(name='Level', description='The level of the event. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='WARN'),
      name?: string(name='Name', description='The event name.', example='Agent_Status_Stopped'),
      product?: string(name='Product', description='The abbreviation of the service name.', example='CloudMonitor'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      resourceId?: string(name='ResourceId', description='The resource ID.', example='xxxxx-1'),
      status?: string(name='Status', description='The status of the event.', example='normal'),
      time?: long(name='Time', description='The time when the event occurred. The value is a timestamp.

Unit: milliseconds.', example='1552199984000'),
    }
  ](name='SystemEvent')
  }(name='SystemEvents', description='The details of the event.'),
}

model DescribeSystemEventAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSystemEventAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a system event.
 *
 * @param request DescribeSystemEventAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSystemEventAttributeResponse
 */
async function describeSystemEventAttributeWithOptions(request: DescribeSystemEventAttributeRequest, runtime: Util.RuntimeOptions): DescribeSystemEventAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemEventAttribute',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a system event.
 *
 * @param request DescribeSystemEventAttributeRequest
 * @return DescribeSystemEventAttributeResponse
 */
async function describeSystemEventAttribute(request: DescribeSystemEventAttributeRequest): DescribeSystemEventAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemEventAttributeWithOptions(request, runtime);
}

model DescribeSystemEventCountRequest {
  endTime?: string(name='EndTime', description='The end of the time range to query. Unit: milliseconds.', example='1635993921000'),
  eventType?: string(name='EventType', description='The type of the system event.

You can call the DescribeSystemEventMetaList operation to obtain the value of the response parameter `EventType`. The value of the EventType parameter indicates the types of system events that occurred for all cloud services in your Alibaba Cloud account. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).', example='StatusNotification'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='17285****'),
  level?: string(name='Level', description='The level of the system event. Valid values:

*   Critical
*   Warn
*   Info

You can call the DescribeSystemEventMetaList operation to obtain the value of the response parameter `Level`. The value of the Level parameter indicates the levels of system events that occurred for all cloud services in your Alibaba Cloud account. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).', example='Info'),
  name?: string(name='Name', description='The name of the system event.

You can call the DescribeSystemEventMetaList operation to obtain the value of the response parameter `Name`. The value of the Name parameter indicates the names of system events that occurred for all cloud services in your Alibaba Cloud account. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).', example='Instance:StateChange'),
  product?: string(name='Product', description='The name of the cloud service.

You can call the DescribeSystemEventMetaList operation to obtain the value of the response parameter `Product`. The value of the Product parameter indicates the names of all cloud services in which the system events of your Alibaba Cloud account occurred. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).', example='ECS'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are used to search for the system event. Valid values:

*   If you want to search for the system event whose content contains a and b, set the value to `a and b`.
*   If you want to search for the system event whose content contains a or b, set the value to `a or b`.', example='ECS'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Unit: milliseconds.', example='1635993541000'),
  status?: string(name='Status', description='The status of the system event.

You can call the DescribeSystemEventMetaList operation to obtain the value of the response parameter `Status`. The value of the Status parameter indicates the status of system events that occurred for all cloud services in your Alibaba Cloud account. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).', example='Normal'),
}

model DescribeSystemEventCountResponseBody = {
  code?: string(name='Code', description='The HTTP status codes.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.

If the request was successful, a success message is returned. If the request failed, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='C7A7B776-0ACE-5A93-9B07-DE8008D9CCDF'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  systemEventCounts?: {
    systemEventCount?: [ 
    {
      content?: string(name='Content', description='The description of the system event.'),
      groupId?: string(name='GroupId', description='The ID of the application group.', example='17285****'),
      instanceName?: string(name='InstanceName', description='The name of the instance.', example='ECS-test'),
      level?: string(name='Level', description='The level of the system event. Valid values:

*   Critical
*   Warn
*   Info', example='Info'),
      name?: string(name='Name', description='The name of the system event.', example='Instance:StateChange'),
      num?: long(name='Num', description='The number of times that the system event has occurred.', example='3'),
      product?: string(name='Product', description='The name of the cloud service in which the system event occurred.', example='ECS'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      resourceId?: string(name='ResourceId', description='The resource ID.', example='i-rj99xc6cptkk64ml****'),
      status?: string(name='Status', description='The status of the system event.', example='Normal'),
      time?: long(name='Time', description='The time when the system event occurred. The value is a timestamp. Unit: milliseconds.', example='1635993751000'),
    }
  ](name='SystemEventCount')
  }(name='SystemEventCounts', description='The details of the system event.'),
}

model DescribeSystemEventCountResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSystemEventCountResponseBody(name='body'),
}

/**
 * @summary Queries the number of times that a system event of a cloud service has occurred.
 *
 * @description ### [](#)Background information
 * You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the cloud services supported by CloudMonitor and their system events.
 * ### [](#)Description
 * This topic provides an example on how to query the number of times that a system event of `Elastic Compute Service (ECS)` has occurred. The returned result shows that the specified system event has occurred three times.
 *
 * @param request DescribeSystemEventCountRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSystemEventCountResponse
 */
async function describeSystemEventCountWithOptions(request: DescribeSystemEventCountRequest, runtime: Util.RuntimeOptions): DescribeSystemEventCountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemEventCount',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of times that a system event of a cloud service has occurred.
 *
 * @description ### [](#)Background information
 * You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the cloud services supported by CloudMonitor and their system events.
 * ### [](#)Description
 * This topic provides an example on how to query the number of times that a system event of `Elastic Compute Service (ECS)` has occurred. The returned result shows that the specified system event has occurred three times.
 *
 * @param request DescribeSystemEventCountRequest
 * @return DescribeSystemEventCountResponse
 */
async function describeSystemEventCount(request: DescribeSystemEventCountRequest): DescribeSystemEventCountResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemEventCountWithOptions(request, runtime);
}

model DescribeSystemEventHistogramRequest {
  endTime?: string(name='EndTime', description='The end time.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1552220485596'),
  eventType?: string(name='EventType', description='The event type.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the types of system events.', example='Exception'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='12345'),
  level?: string(name='Level', description='The level of the event. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='CRITICAL'),
  name?: string(name='Name', description='The event name.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the names of system events.', example='BucketIngressBandwidth'),
  product?: string(name='Product', description='The abbreviation of the service name.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the abbreviations of service names.', example='OSS'),
  regionId?: string(name='RegionId'),
  searchKeywords?: string(name='SearchKeywords', description='The keywords that are used to search for the system event. Valid values:

*   If you want to search for the system event whose content contains a and b, set the value to `a and b`.
*   If you want to search for the system event whose content contains a or b, set the value to `a or b`.', example='cms'),
  startTime?: string(name='StartTime', description='The start time.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1552209685596'),
  status?: string(name='Status', description='The event status.

>  You can call the [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html) operation to query the status of system events.', example='normal'),
}

model DescribeSystemEventHistogramResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='486029C9-53E1-44B4-85A8-16A571A043FD'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values: true: The request was successful. false: The request failed.', example='true'),
  systemEventHistograms?: {
    systemEventHistogram?: [ 
    {
      count?: long(name='Count', description='The number of times the system event occurred.', example='2'),
      endTime?: long(name='EndTime', description='The end time.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1552225753000'),
      startTime?: long(name='StartTime', description='The start time.

This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.', example='1552225770000'),
    }
  ](name='SystemEventHistogram')
  }(name='SystemEventHistograms', description='The information about the number of times the system event occurred during each interval of a time period.'),
}

model DescribeSystemEventHistogramResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSystemEventHistogramResponseBody(name='body'),
}

/**
 * @summary Queries the number of times a system event occurred during each interval within a period of time.
 *
 * @param request DescribeSystemEventHistogramRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSystemEventHistogramResponse
 */
async function describeSystemEventHistogramWithOptions(request: DescribeSystemEventHistogramRequest, runtime: Util.RuntimeOptions): DescribeSystemEventHistogramResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.searchKeywords)) {
    query['SearchKeywords'] = request.searchKeywords;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemEventHistogram',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the number of times a system event occurred during each interval within a period of time.
 *
 * @param request DescribeSystemEventHistogramRequest
 * @return DescribeSystemEventHistogramResponse
 */
async function describeSystemEventHistogram(request: DescribeSystemEventHistogramRequest): DescribeSystemEventHistogramResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemEventHistogramWithOptions(request, runtime);
}

model DescribeSystemEventMetaListRequest {
  regionId?: string(name='RegionId'),
}

model DescribeSystemEventMetaListResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  data?: {
    resource?: [ 
    {
      eventType?: string(name='EventType', description='The type of the system event. Valid values:

*   StatusNotification
*   Exception
*   Maintenance', example='Exception'),
      level?: string(name='Level', description='The level of the alert. Valid values:

*   CRITICAL
*   WARN
*   INFO', example='INFO'),
      name?: string(name='Name', description='The name of the system event.', example='SelectFailureRate'),
      nameDesc?: string(name='NameDesc', description='The description of the system event, in Chinese.', example='High query failure rate'),
      nameDesc_en?: string(name='NameDesc.En'),
      product?: string(name='Product', description='The abbreviation of the service name.', example='ADS'),
      status?: string(name='Status', description='The status of the system event.', example='failed'),
      statusDesc?: string(name='StatusDesc', description='The description of the event status.', example='Operation Failed'),
    }
  ](name='Resource')
  }(name='Data', description='The detailed meta information.'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='A6582C8B-E67C-4A19-BC15-EAEFEBDC7995'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DescribeSystemEventMetaListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSystemEventMetaListResponseBody(name='body'),
}

/**
 * @param request DescribeSystemEventMetaListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSystemEventMetaListResponse
 */
async function describeSystemEventMetaListWithOptions(request: DescribeSystemEventMetaListRequest, runtime: Util.RuntimeOptions): DescribeSystemEventMetaListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemEventMetaList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeSystemEventMetaListRequest
 * @return DescribeSystemEventMetaListResponse
 */
async function describeSystemEventMetaList(request: DescribeSystemEventMetaListRequest): DescribeSystemEventMetaListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemEventMetaListWithOptions(request, runtime);
}

model DescribeTagKeyListRequest {
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Maximum value: 100. Default value: 50.', example='10'),
  regionId?: string(name='RegionId'),
}

model DescribeTagKeyListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='Specified parameter PageSize is not valid.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B04B8CF3-4489-432D-83BA-6F128E5F2293'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  tagKeys?: {
    tagKey?: [ string ](name='TagKey')
  }(name='TagKeys', description='The tag keys returned.'),
}

model DescribeTagKeyListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagKeyListResponseBody(name='body'),
}

/**
 * @param request DescribeTagKeyListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagKeyListResponse
 */
async function describeTagKeyListWithOptions(request: DescribeTagKeyListRequest, runtime: Util.RuntimeOptions): DescribeTagKeyListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTagKeyList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeTagKeyListRequest
 * @return DescribeTagKeyListResponse
 */
async function describeTagKeyList(request: DescribeTagKeyListRequest): DescribeTagKeyListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagKeyListWithOptions(request, runtime);
}

model DescribeTagValueListRequest {
  pageNumber?: int32(name='PageNumber', description='The number of the page to return.

Pages start from page 1. Default value: 1.', example='1'),
  pageSize?: int32(name='PageSize', description='The number of entries to return on each page.

Valid values: 1 to 100. Pages start from page 1. Default value: 50.', example='10'),
  regionId?: string(name='RegionId'),
  tagKey?: string(name='TagKey', description='The key of the tag whose values you want to query.

For more information about how to obtain a tag key, see [DescribeTagKeyList](https://help.aliyun.com/document_detail/145558.html).

This parameter is required.', example='tagKey1'),
}

model DescribeTagValueListResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The value 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B04B8CF3-4489-432D-83BA-6F128E4F2295'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  tagValues?: {
    tagValue?: [ string ](name='TagValue')
  }(name='TagValues', description='The tag values returned.'),
}

model DescribeTagValueListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTagValueListResponseBody(name='body'),
}

/**
 * @description This topic provides an example of how to query the tag values corresponding to `tagKey1`. The return results are `tagValue1` and `tagValue2`.
 *
 * @param request DescribeTagValueListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeTagValueListResponse
 */
async function describeTagValueListWithOptions(request: DescribeTagValueListRequest, runtime: Util.RuntimeOptions): DescribeTagValueListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tagKey)) {
    query['TagKey'] = request.tagKey;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTagValueList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description This topic provides an example of how to query the tag values corresponding to `tagKey1`. The return results are `tagValue1` and `tagValue2`.
 *
 * @param request DescribeTagValueListRequest
 * @return DescribeTagValueListResponse
 */
async function describeTagValueList(request: DescribeTagValueListRequest): DescribeTagValueListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagValueListWithOptions(request, runtime);
}

model DescribeUnhealthyHostAvailabilityRequest {
  id?: [ long ](name='Id', description='This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model DescribeUnhealthyHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ACBDBB40-DFB6-4F4C-8957-51FFB233969C'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
  unhealthyList?: {
    nodeTaskInstance?: [ 
    {
      id?: long(name='Id', description='The ID of the availability monitoring task.', example='123456'),
      instanceList?: {
        string?: [ string ](name='String')
      }(name='InstanceList', description='The unhealthy instances that are detected by the availability monitoring task.'),
    }
  ](name='NodeTaskInstance')
  }(name='UnhealthyList', description='The unhealthy instances that are detected by the specified availability monitoring tasks.'),
}

model DescribeUnhealthyHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUnhealthyHostAvailabilityResponseBody(name='body'),
}

/**
 * @param request DescribeUnhealthyHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUnhealthyHostAvailabilityResponse
 */
async function describeUnhealthyHostAvailabilityWithOptions(request: DescribeUnhealthyHostAvailabilityRequest, runtime: Util.RuntimeOptions): DescribeUnhealthyHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUnhealthyHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeUnhealthyHostAvailabilityRequest
 * @return DescribeUnhealthyHostAvailabilityResponse
 */
async function describeUnhealthyHostAvailability(request: DescribeUnhealthyHostAvailabilityRequest): DescribeUnhealthyHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUnhealthyHostAvailabilityWithOptions(request, runtime);
}

model DisableActiveMetricRuleRequest {
  product?: string(name='Product', description='The service for which you want to disable one-click alert. Valid values:

*   ecs: Elastic Compute Service (ECS)
*   rds: ApsaraDB RDS
*   slb: Server Load Balancer (SLB)
*   redis_standard: ApsaraDB for Redis of the standard architecture
*   redis_sharding: ApsaraDB for Redis of the cluster architecture
*   redis_splitrw: ApsaraDB for Redis of the read/write splitting architecture
*   mongodb: ApsaraDB for MongoDB of the replica set architecture
*   mongodb_sharding: ApsaraDB for MongoDB of the sharded cluster architecture
*   hbase: ApsaraDB for HBase
*   elasticsearch: Elasticsearch
*   opensearch: Open Search

This parameter is required.', example='ecs'),
  regionId?: string(name='RegionId'),
}

model DisableActiveMetricRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F82E6667-7811-4BA0-842F-5B2DC42BBAAD'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model DisableActiveMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableActiveMetricRuleResponseBody(name='body'),
}

/**
 * @param request DisableActiveMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableActiveMetricRuleResponse
 */
async function disableActiveMetricRuleWithOptions(request: DisableActiveMetricRuleRequest, runtime: Util.RuntimeOptions): DisableActiveMetricRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableActiveMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DisableActiveMetricRuleRequest
 * @return DisableActiveMetricRuleResponse
 */
async function disableActiveMetricRule(request: DisableActiveMetricRuleRequest): DisableActiveMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableActiveMetricRuleWithOptions(request, runtime);
}

model DisableEventRulesRequest {
  regionId?: string(name='RegionId'),
  ruleNames?: [ string ](name='RuleNames', description='This parameter is required.', example='ruleName1'),
}

model DisableEventRulesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='3FD0E8B5-F132-4F4E-A081-2878AF378B12'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model DisableEventRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableEventRulesResponseBody(name='body'),
}

/**
 * @param request DisableEventRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableEventRulesResponse
 */
async function disableEventRulesWithOptions(request: DisableEventRulesRequest, runtime: Util.RuntimeOptions): DisableEventRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleNames)) {
    query['RuleNames'] = request.ruleNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableEventRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DisableEventRulesRequest
 * @return DisableEventRulesResponse
 */
async function disableEventRules(request: DisableEventRulesRequest): DisableEventRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableEventRulesWithOptions(request, runtime);
}

model DisableHostAvailabilityRequest {
  id?: [ long ](name='Id', description='This parameter is required.', example='12345'),
  regionId?: string(name='RegionId'),
}

model DisableHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The status code.

>  The status code 200 indicates a success.', example='200'),
  message?: string(name='Message', description='The error message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ACBDBB40-DFB6-4F4C-8957-51FFB233969C'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   true: successful.
*   false: failed.', example='true'),
}

model DisableHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableHostAvailabilityResponseBody(name='body'),
}

/**
 * @param request DisableHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableHostAvailabilityResponse
 */
async function disableHostAvailabilityWithOptions(request: DisableHostAvailabilityRequest, runtime: Util.RuntimeOptions): DisableHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DisableHostAvailabilityRequest
 * @return DisableHostAvailabilityResponse
 */
async function disableHostAvailability(request: DisableHostAvailabilityRequest): DisableHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableHostAvailabilityWithOptions(request, runtime);
}

model DisableMetricRulesRequest {
  regionId?: string(name='RegionId'),
  ruleId?: [ string ](name='RuleId', description='The ID of the alert rule. Valid values of N: 1 to 20.

This parameter is required.', example='detect_87****_HTTP_HttpLatency'),
}

model DisableMetricRulesResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='RuleId is mandatory for this action.'),
  requestId?: string(name='RequestId', description='The request ID.', example='FF38D33A-67C1-40EB-AB65-FAEE51EDB644'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DisableMetricRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableMetricRulesResponseBody(name='body'),
}

/**
 * @summary Disables alert rules.
 *
 * @param request DisableMetricRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableMetricRulesResponse
 */
async function disableMetricRulesWithOptions(request: DisableMetricRulesRequest, runtime: Util.RuntimeOptions): DisableMetricRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableMetricRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables alert rules.
 *
 * @param request DisableMetricRulesRequest
 * @return DisableMetricRulesResponse
 */
async function disableMetricRules(request: DisableMetricRulesRequest): DisableMetricRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableMetricRulesWithOptions(request, runtime);
}

model DisableSiteMonitorsRequest {
  regionId?: string(name='RegionId'),
  taskIds?: string(name='TaskIds', description='The ID of the site monitoring task. Separate multiple IDs with commas (,).

This parameter is required.', example='49f7b317-7645-4cc9-94fd-ea42e522****,49f7b317-7645-4cc9-94fd-ea42e522****'),
}

model DisableSiteMonitorsResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: {
    count?: int32(name='count', description='The number of detection points.', example='0'),
  }(name='Data', description='The number of detection points that are affected by the site monitoring tasks.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='3fcd12e7-d387-42ee-b77e-661c775bb17f'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model DisableSiteMonitorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableSiteMonitorsResponseBody(name='body'),
}

/**
 * @summary Disables site monitoring tasks.
 *
 * @param request DisableSiteMonitorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableSiteMonitorsResponse
 */
async function disableSiteMonitorsWithOptions(request: DisableSiteMonitorsRequest, runtime: Util.RuntimeOptions): DisableSiteMonitorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableSiteMonitors',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Disables site monitoring tasks.
 *
 * @param request DisableSiteMonitorsRequest
 * @return DisableSiteMonitorsResponse
 */
async function disableSiteMonitors(request: DisableSiteMonitorsRequest): DisableSiteMonitorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableSiteMonitorsWithOptions(request, runtime);
}

model EnableActiveMetricRuleRequest {
  product?: string(name='Product', description='The cloud service for which you want to enable initiative alert. Valid values:

*   ecs: Elastic Compute Service (ECS)
*   rds: ApsaraDB RDS
*   slb: Server Load Balancer (SLB)
*   redis_standard: ApsaraDB for Redis of the standard architecture
*   redis_sharding: ApsaraDB for Redis of the cluster architecture
*   redis_splitrw: ApsaraDB for Redis of the read/write splitting architecture
*   mongodb: ApsaraDB for MongoDB of the replica set architecture
*   mongodb_sharding: ApsaraDB for MongoDB of the sharded cluster architecture
*   hbase: ApsaraDB for HBase
*   elasticsearch: Elasticsearch
*   opensearch: OpenSearch

This parameter is required.', example='ecs'),
  regionId?: string(name='RegionId'),
}

model EnableActiveMetricRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F82E6667-7811-4BA0-842F-5B2DC42BBAAD'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model EnableActiveMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableActiveMetricRuleResponseBody(name='body'),
}

/**
 * @param request EnableActiveMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableActiveMetricRuleResponse
 */
async function enableActiveMetricRuleWithOptions(request: EnableActiveMetricRuleRequest, runtime: Util.RuntimeOptions): EnableActiveMetricRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableActiveMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EnableActiveMetricRuleRequest
 * @return EnableActiveMetricRuleResponse
 */
async function enableActiveMetricRule(request: EnableActiveMetricRuleRequest): EnableActiveMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableActiveMetricRuleWithOptions(request, runtime);
}

model EnableEventRulesRequest {
  regionId?: string(name='RegionId'),
  ruleNames?: [ string ](name='RuleNames', description='This parameter is required.', example='ruleName1'),
}

model EnableEventRulesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='20F2896A-6684-4A04-8255-4155B1593C70'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model EnableEventRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableEventRulesResponseBody(name='body'),
}

/**
 * @param request EnableEventRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableEventRulesResponse
 */
async function enableEventRulesWithOptions(request: EnableEventRulesRequest, runtime: Util.RuntimeOptions): EnableEventRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleNames)) {
    query['RuleNames'] = request.ruleNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableEventRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EnableEventRulesRequest
 * @return EnableEventRulesResponse
 */
async function enableEventRules(request: EnableEventRulesRequest): EnableEventRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableEventRulesWithOptions(request, runtime);
}

model EnableHostAvailabilityRequest {
  id?: [ long ](name='Id', description='This parameter is required.', example='123456'),
  regionId?: string(name='RegionId'),
}

model EnableHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The status code.

>  The HTTP status code 200 indicates a success.', example='200'),
  message?: string(name='Message', description='The error message.', example='User not authorized to operate on the specified resource.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='ACBDBB40-DFB6-4F4C-8957-51FFB233969C'),
  success?: boolean(name='Success', description='Indicates whether the operation was successful. Valid values:

*   true: successful.
*   false: failed.', example='true'),
}

model EnableHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableHostAvailabilityResponseBody(name='body'),
}

/**
 * @param request EnableHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableHostAvailabilityResponse
 */
async function enableHostAvailabilityWithOptions(request: EnableHostAvailabilityRequest, runtime: Util.RuntimeOptions): EnableHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request EnableHostAvailabilityRequest
 * @return EnableHostAvailabilityResponse
 */
async function enableHostAvailability(request: EnableHostAvailabilityRequest): EnableHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableHostAvailabilityWithOptions(request, runtime);
}

model EnableMetricRuleBlackListRequest {
  id?: string(name='Id', description='The IDs of the blacklist policies. Separate multiple IDs with commas (,). You can specify up to 50 IDs.

For information about how to obtain the ID of a blacklist policy, see [DescribeMetricRuleBlackList](https://help.aliyun.com/document_detail/457257.html).

> You can also set this parameter to a JSON array. Example: `["a9ad2ac2-3ed9-11ed-b878-0242ac12****","5cb8a9a4-198f-4651-a353-f8b28788****"]`.

This parameter is required.', example='a9ad2ac2-3ed9-11ed-b878-0242ac12****'),
  isEnable?: boolean(name='IsEnable', description='Specifies whether to enable the blacklist policy. Valid values:

*   true: The blacklist policy is enabled.
*   false (default): The blacklist policy is disabled.

This parameter is required.', example='true'),
  regionId?: string(name='RegionId'),
}

model EnableMetricRuleBlackListResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  count?: int32(name='Count', description='The number of blacklist policies that are enabled or disabled.', example='1'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='94869866-1621-3652-BBC9-72A47B2AC2F5'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model EnableMetricRuleBlackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableMetricRuleBlackListResponseBody(name='body'),
}

/**
 * @summary Enables or disables multiple blacklist policies at a time.
 *
 * @param request EnableMetricRuleBlackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableMetricRuleBlackListResponse
 */
async function enableMetricRuleBlackListWithOptions(request: EnableMetricRuleBlackListRequest, runtime: Util.RuntimeOptions): EnableMetricRuleBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.isEnable)) {
    query['IsEnable'] = request.isEnable;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableMetricRuleBlackList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables or disables multiple blacklist policies at a time.
 *
 * @param request EnableMetricRuleBlackListRequest
 * @return EnableMetricRuleBlackListResponse
 */
async function enableMetricRuleBlackList(request: EnableMetricRuleBlackListRequest): EnableMetricRuleBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableMetricRuleBlackListWithOptions(request, runtime);
}

model EnableMetricRulesRequest {
  regionId?: string(name='RegionId'),
  ruleId?: [ string ](name='RuleId', description='The IDs of the alert rules.

Valid values of N: 1 to 100.

For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

This parameter is required.', example='ab05733c97b7ce239fb1b53393dc1697c123****'),
}

model EnableMetricRulesResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='FF38D33A-67C1-40EB-AB65-FAEE51EDB644'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model EnableMetricRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableMetricRulesResponseBody(name='body'),
}

/**
 * @summary Enables one or more alert rules.
 *
 * @param request EnableMetricRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableMetricRulesResponse
 */
async function enableMetricRulesWithOptions(request: EnableMetricRulesRequest, runtime: Util.RuntimeOptions): EnableMetricRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableMetricRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables one or more alert rules.
 *
 * @param request EnableMetricRulesRequest
 * @return EnableMetricRulesResponse
 */
async function enableMetricRules(request: EnableMetricRulesRequest): EnableMetricRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableMetricRulesWithOptions(request, runtime);
}

model EnableSiteMonitorsRequest {
  regionId?: string(name='RegionId'),
  taskIds?: string(name='TaskIds', description='The ID of the site monitoring task. Separate multiple IDs with commas (,).

This parameter is required.', example='49f7b317-7645-4cc9-94fd-ea42e522****,49f7b317-7645-4cc9-94fd-ea42e522****'),
}

model EnableSiteMonitorsResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  data?: {
    count?: int32(name='count', description='The number of detection points.', example='0'),
  }(name='Data', description='The number of detection points that are affected by the site monitoring tasks.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='3fcd12e7-d387-42ee-b77e-661c775bb17f'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model EnableSiteMonitorsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableSiteMonitorsResponseBody(name='body'),
}

/**
 * @summary Enables site monitoring tasks.
 *
 * @param request EnableSiteMonitorsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableSiteMonitorsResponse
 */
async function enableSiteMonitorsWithOptions(request: EnableSiteMonitorsRequest, runtime: Util.RuntimeOptions): EnableSiteMonitorsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskIds)) {
    query['TaskIds'] = request.taskIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableSiteMonitors',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Enables site monitoring tasks.
 *
 * @param request EnableSiteMonitorsRequest
 * @return EnableSiteMonitorsResponse
 */
async function enableSiteMonitors(request: EnableSiteMonitorsRequest): EnableSiteMonitorsResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableSiteMonitorsWithOptions(request, runtime);
}

model InstallMonitoringAgentRequest {
  force?: boolean(name='Force', description='Specifies whether to install the CloudMonitor agent. Valid values:

*   true (default value): yes
*   false: no', example='true'),
  installCommand?: string(name='InstallCommand', description='Specifies whether to install the CloudMonitor agent on all ECS instances that belong to the current Alibaba Cloud account. Valid values:

*   `onlyInstallNotHasAgent`: installs the latest version of the CloudMonitor agent only on ECS instances on which the agent is not installed.
*   `onlyUpgradeAgent`: upgrades the CloudMonitor agent to the latest version only for ECS instances on which an earlier version of the agent is installed.
*   `installAndUpgrade`: installs the latest version of the CloudMonitor agent on ECS instances on which the agent is not installed, and upgrades the CloudMonitor agent to the latest version for ECS instances on which an earlier version of the agent is installed.

>  If you set the InstallCommand parameter, the `InstanceIds` parameter does not take effect.', example='onlyInstallNotHasAgent'),
  instanceIds?: [ string ](name='InstanceIds', example='i-m5e0k0bexac8tykr****'),
  regionId?: string(name='RegionId'),
}

model InstallMonitoringAgentResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0BDAF8A8-04DC-5F0C-90E4-724D42C41945'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model InstallMonitoringAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InstallMonitoringAgentResponseBody(name='body'),
}

/**
 * @description ## Prerequisites
 * The Cloud Assistant client is installed on an ECS instance. For more information about how to install the Cloud Assistant client, see [Overview](https://help.aliyun.com/document_detail/64601.html).
 *
 * @param request InstallMonitoringAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InstallMonitoringAgentResponse
 */
async function installMonitoringAgentWithOptions(request: InstallMonitoringAgentRequest, runtime: Util.RuntimeOptions): InstallMonitoringAgentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.force)) {
    query['Force'] = request.force;
  }
  if (!Util.isUnset(request.installCommand)) {
    query['InstallCommand'] = request.installCommand;
  }
  if (!Util.isUnset(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'InstallMonitoringAgent',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description ## Prerequisites
 * The Cloud Assistant client is installed on an ECS instance. For more information about how to install the Cloud Assistant client, see [Overview](https://help.aliyun.com/document_detail/64601.html).
 *
 * @param request InstallMonitoringAgentRequest
 * @return InstallMonitoringAgentResponse
 */
async function installMonitoringAgent(request: InstallMonitoringAgentRequest): InstallMonitoringAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return installMonitoringAgentWithOptions(request, runtime);
}

model ModifyGroupMonitoringAgentProcessRequest {
  alertConfig?: [ 
    {
      comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator that is used to compare the metric value with the threshold. Valid values of N: 1 to 200. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold.
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday.
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

This parameter is required.', example='GreaterThanOrEqualToThreshold'),
      effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective. Valid values of N: 1 to 200.', example='00:00-22:59'),
      escalationsLevel?: string(name='EscalationsLevel', description='The level of the alert. Valid values of N: 1 to 200. Valid values:

*   critical (default value): critical
*   warn: warning
*   info: information

This parameter is required.', example='warn'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective. Valid values of N: 1 to 200.', example='23:00-23:59'),
      silenceTime?: string(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Valid values of N: 1 to 200.

Unit: seconds. Minimum value: 3600, which is equivalent to one hour. Default value: 86400, which is equivalent to one day.

>  Only one alert notification is sent during a mute period even if the metric value exceeds the alert threshold during consecutive checks.', example='86400'),
      statistics?: string(name='Statistics', description='The statistical aggregation method that is used to calculate the metric values. Valid values of N: 1 to 200.

>  Set the value to Average.', example='Average'),
      targetList?: [ 
        {
          arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource.

For information about how to obtain the ARN of a resource, see [DescribeMetricRuleTargets](https://help.aliyun.com/document_detail/121592.html).

Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. Fields:

- {Service name abbreviation}: the abbreviation of the service name. Valid value: mns.
- {userId}: the ID of the Alibaba Cloud account.
- {regionId}: the region ID of the message queue or topic.
- {Resource type}: the type of the resource for which alerts are triggered. Valid values: 
    - **queues** 
    - **topics** 
- {Resourcename}: the name of the resource. 
  - If the resource type is set to **queues**, the resource name is the name of the message queue. 
  - If the resource type is set to **topics**, the resource name is the name of the topic.`', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
          id?: string(name='Id', description='The ID of the resource for which alerts are triggered.

For information about how to obtain the ID of a resource for which alerts are triggered, see [DescribeMetricRuleTargets](https://help.aliyun.com/document_detail/121592.html).', example='1'),
          jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
          level?: string(name='Level', description='The level of the alert. Valid values:

*   INFO: information
*   WARN: warning
*   CRITICAL: critical', example='["INFO", "WARN", "CRITICAL"]'),
        }
      ](name='TargetList', description='The alert trigger.'),
      threshold?: string(name='Threshold', description='The alert threshold. Valid values of N: 1 to 200.

This parameter is required.', example='5'),
      times?: string(name='Times', description='The number of times for which the threshold can be consecutively exceeded. Valid values of N: 1 to 200. Default value: 3.

>  A metric triggers an alert only after the metric value reaches the threshold consecutively for the specified times.

This parameter is required.', example='3'),
      webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule. Valid values of N: 1 to 200.', example='http://www.aliyun.com'),
    }
  ](name='AlertConfig', description='The alert rule configurations.

This parameter is required.'),
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='6780****'),
  id?: string(name='Id', description='The ID of the process monitoring task.

This parameter is required.', example='92E3065F-0980-4E31-9AA0-BA6****'),
  matchExpressFilterRelation?: string(name='MatchExpressFilterRelation', description='The logical operator used between conditional expressions that are used to match instances. Valid values:

*   all
*   and
*   or', example='and'),
  regionId?: string(name='RegionId'),
}

model ModifyGroupMonitoringAgentProcessResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7985D471-3FA8-4EE9-8F4B-45C19DF3D36F'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model ModifyGroupMonitoringAgentProcessResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGroupMonitoringAgentProcessResponseBody(name='body'),
}

/**
 * @param request ModifyGroupMonitoringAgentProcessRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyGroupMonitoringAgentProcessResponse
 */
async function modifyGroupMonitoringAgentProcessWithOptions(request: ModifyGroupMonitoringAgentProcessRequest, runtime: Util.RuntimeOptions): ModifyGroupMonitoringAgentProcessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertConfig)) {
    query['AlertConfig'] = request.alertConfig;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.matchExpressFilterRelation)) {
    query['MatchExpressFilterRelation'] = request.matchExpressFilterRelation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyGroupMonitoringAgentProcess',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyGroupMonitoringAgentProcessRequest
 * @return ModifyGroupMonitoringAgentProcessResponse
 */
async function modifyGroupMonitoringAgentProcess(request: ModifyGroupMonitoringAgentProcessRequest): ModifyGroupMonitoringAgentProcessResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyGroupMonitoringAgentProcessWithOptions(request, runtime);
}

model ModifyHostAvailabilityRequest {
  alertConfig?: {
    endTime?: int32(name='EndTime', description='The end of the time range during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

> Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='22'),
    notifyType?: int32(name='NotifyType', description='The alert notification methods. Valid values:

0: Alert notifications are sent by using emails and DingTalk chatbots.

This parameter is required.', example='0'),
    silenceTime?: int32(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400. The default value indicates one day.', example='86400'),
    startTime?: int32(name='StartTime', description='The beginning of the time range during which the alert rule is effective. Valid values: 0 to 23.

For example, if the `AlertConfig.StartTime` parameter is set to 0 and the `AlertConfig.EndTime` parameter is set to 22, the alert rule is effective from 00:00:00 to 22:00:00.

> Alert notifications are sent based on the specified threshold only if the alert rule is effective.', example='0'),
    webHook?: string(name='WebHook', description='The callback URL.', example='https://www.aliyun.com/webhook.json'),
  }(name='AlertConfig'),
  taskOption?: {
    httpHeader?: string(name='HttpHeader', description='The header of the HTTP request. Format: `Parameter name:Parameter value`. Separate multiple parameters with carriage return characters. Example:

    params1:value1
    params2:value2', example='params1:value1'),
    httpMethod?: string(name='HttpMethod', description='The HTTP request method. Valid values:

*   GET
*   POST
*   HEAD

> This parameter must be specified when TaskType is set to HTTP. For more information about how to configure the TaskType parameter, see [CreateHostAvailability](https://help.aliyun.com/document_detail/115317.html).', example='GET'),
    httpNegative?: boolean(name='HttpNegative', description='The method to trigger an alert. The alert can be triggered based on whether the specified alert rule is included in the response body. Valid values:

*   true: If the HTTP response body includes the alert rule, an alert is triggered.
*   false: If the HTTP response does not include the alert rule, an alert is triggered.

> This parameter must be specified when TaskType is set to HTTP. For more information about how to configure the TaskType parameter, see [CreateHostAvailability](https://help.aliyun.com/document_detail/115317.html).', example='true'),
    httpPostContent?: string(name='HttpPostContent', description='The content of the HTTP POST request.', example='params1=value1'),
    httpResponseCharset?: string(name='HttpResponseCharset', description='The character set that is used in the HTTP response.

> Only UTF-8 is supported.', example='UTF-8'),
    httpResponseMatchContent?: string(name='HttpResponseMatchContent', description='The response to the HTTP request.', example='ok'),
    httpURI?: string(name='HttpURI', description='The URI that you want to monitor. This parameter is required if the TaskType parameter is set to HTTP or Telnet.', example='https://www.aliyun.com'),
    interval?: int32(name='Interval', description='The interval at which detection requests are sent. Unit: seconds. Valid values: 15, 30, 60, 120, 300, 900, 1800, and 3600.

> This parameter is available only for the CloudMonitor agent V3.5.1 or later.', example='60'),
    telnetOrPingHost?: string(name='TelnetOrPingHost', description='The domain name or IP address that you want to monitor.

>  This parameter is required if the TaskType parameter is set to PING. For more information about how to set the TaskType parameter, see [CreateHostAvailability](https://help.aliyun.com/document_detail/115317.html).', example='www.aliyun.com'),
  }(name='TaskOption'),
  alertConfigEscalationList?: [ 
    {
      aggregate?: string(name='Aggregate', description='The method used to calculate the metric values that trigger alerts. Valid values of N: 1 to 21. The value of this parameter varies based on the metric. The following items show the correspondence between metrics and calculation methods:

*   HttpStatus: Value
*   HttpLatency: Average
*   TelnetStatus: Value
*   TelnetLatency: Average
*   PingLostRate: Average

> The value Value indicates the original value and is used for metrics such as status codes. The value Average indicates the average value and is used for metrics such as the latency and packet loss rate.', example='Value'),
      metricName?: string(name='MetricName', description='The metric for which the alert feature is enabled. Valid values of N: 1 to 21. Valid values:

*   HttpStatus: HTTP status code
*   HttpLatency: HTTP response time
*   TelnetStatus: Telnet status code
*   TelnetLatency: Telnet response time
*   PingLostRate: Ping packet loss rate

This parameter is required.', example='HttpStatus'),
      operator?: string(name='Operator', description='The comparison operator that is used in the alert rule. Valid values of N: 1 to 21. Valid values:

*   `>`
*   `>=`
*   `<`
*   `<=`
*   `=`', example='>'),
      times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an alert is triggered. Valid values of N: 1 to 21.', example='3'),
      value?: string(name='Value', description='The alert threshold. Valid values of N: 1 to 21.', example='3'),
    }
  ](name='AlertConfigEscalationList', description='The alert configurations.

This parameter is required.'),
  alertConfigTargetList?: [ 
    {
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource.

Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. Fields:

*   {Service name abbreviation}: the abbreviation of the service name. Set the value to Simple Message Queue (formerly MNS) (SMQ).

*   {userId}: the ID of the Alibaba Cloud account.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {Resource type}: the type of the resource for which alerts are triggered. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.', example='acs:mns:cn-hangzhou:111:/queues/test/message'),
      id?: string(name='Id', description='The ID of the resource for which alerts are triggered.', example='1'),
      jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
      level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='["INFO", "WARN", "CRITICAL"]'),
    }
  ](name='AlertConfigTargetList', description='The information about the resources for which alerts are triggered.'),
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  id?: long(name='Id', description='The ID of the availability monitoring task.

This parameter is required.', example='12345'),
  instanceList?: [ string ](name='InstanceList', description='The ECS instances that are monitored. Valid values of N: 1 to 21.

> This parameter must be specified when `TaskScope` is set to `GROUP_SPEC_INSTANCE`.', example='i-absdfkwl321****'),
  regionId?: string(name='RegionId'),
  taskName?: string(name='TaskName', description='The name of the availability monitoring task.

This parameter is required.', example='task2'),
  taskScope?: string(name='TaskScope', description='The range of instances that are monitored by the availability monitoring task. Valid values:

*   GROUP: All Elastic Compute Service (ECS) instances in the application group are monitored.
*   GROUP_SPEC_INSTANCE: Specified ECS instances in the application group are monitored. The TaskScope parameter must be used in combination with the InstanceList.N parameter. The InstanceList.N parameter specifies the ECS instances to be monitored.', example='GROUP'),
}

model ModifyHostAvailabilityResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='16E815A3-47E1-4290-87F9-D5C99471FF45'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyHostAvailabilityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyHostAvailabilityResponseBody(name='body'),
}

/**
 * @summary Modifies an availability monitoring task.
 *
 * @description This topic provides an example on how to change the name of an availability monitoring task named `12345` in an application group named `123456` to `task2`.
 *
 * @param request ModifyHostAvailabilityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyHostAvailabilityResponse
 */
async function modifyHostAvailabilityWithOptions(request: ModifyHostAvailabilityRequest, runtime: Util.RuntimeOptions): ModifyHostAvailabilityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertConfigEscalationList)) {
    query['AlertConfigEscalationList'] = request.alertConfigEscalationList;
  }
  if (!Util.isUnset(request.alertConfigTargetList)) {
    query['AlertConfigTargetList'] = request.alertConfigTargetList;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instanceList)) {
    query['InstanceList'] = request.instanceList;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.taskScope)) {
    query['TaskScope'] = request.taskScope;
  }
  if (!Util.isUnset(request.alertConfig)) {
    query['AlertConfig'] = request.alertConfig;
  }
  if (!Util.isUnset(request.taskOption)) {
    query['TaskOption'] = request.taskOption;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHostAvailability',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an availability monitoring task.
 *
 * @description This topic provides an example on how to change the name of an availability monitoring task named `12345` in an application group named `123456` to `task2`.
 *
 * @param request ModifyHostAvailabilityRequest
 * @return ModifyHostAvailabilityResponse
 */
async function modifyHostAvailability(request: ModifyHostAvailabilityRequest): ModifyHostAvailabilityResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHostAvailabilityWithOptions(request, runtime);
}

model ModifyHostInfoRequest {
  hostName?: string(name='HostName', description='The name of the host.', example='portalHost'),
  instanceId?: string(name='InstanceId', description='The ID of the instance. Only hosts not on Alibaba Cloud are supported.

This parameter is required.', example='host-R_NSWNV****'),
  regionId?: string(name='RegionId'),
}

model ModifyHostInfoResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EBB5215C-44AB-4000-A2D7-48634FDC4F04'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model ModifyHostInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyHostInfoResponseBody(name='body'),
}

/**
 * @description ****
 *
 * @param request ModifyHostInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyHostInfoResponse
 */
async function modifyHostInfoWithOptions(request: ModifyHostInfoRequest, runtime: Util.RuntimeOptions): ModifyHostInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hostName)) {
    query['HostName'] = request.hostName;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHostInfo',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description ****
 *
 * @param request ModifyHostInfoRequest
 * @return ModifyHostInfoResponse
 */
async function modifyHostInfo(request: ModifyHostInfoRequest): ModifyHostInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHostInfoWithOptions(request, runtime);
}

model ModifyHybridMonitorNamespaceRequest {
  description?: string(name='Description', description='The description of the namespace.'),
  namespace?: string(name='Namespace', description='The name of the namespace.

The name can contain letters, digits, and hyphens (-).

For information about how to obtain the name of a namespace, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='aliyun'),
  regionId?: string(name='RegionId'),
  spec?: string(name='Spec', description='The data retention period. Valid values:

*   cms.s1.large: Data is stored for 15 days.
*   cms.s1.xlarge: Data is stored for 32 days.
*   cms.s1.2xlarge: Data is stored for 63 days.
*   cms.s1.3xlarge: Data is stored for 93 days.
*   cms.s1.6xlarge: Data is stored for 185 days.
*   cms.s1.12xlarge: Data is stored for 376 days.

For information about the pricing for different retention periods, see the **Pricing** section in [Billing of the dashboard feature](https://help.aliyun.com/document_detail/223532.html).', example='cms.s1.2xlarge'),
}

model ModifyHybridMonitorNamespaceResponseBody = {
  code?: string(name='Code', description='The returned message.', example='Success'),
  message?: string(name='Message', description='The error message.', example='%s'),
  requestId?: string(name='RequestId', description='The request ID.', example='E190AB2E-7BF9-59B7-9DDC-7CB1782C5ECD'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyHybridMonitorNamespaceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyHybridMonitorNamespaceResponseBody(name='body'),
}

/**
 * @summary Modifies a namespace.
 *
 * @description This topic provides an example on how to change the data retention period of the `aliyun` namespace to `cms.s1.2xlarge`. The response shows that the namespace is modified.
 *
 * @param request ModifyHybridMonitorNamespaceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyHybridMonitorNamespaceResponse
 */
async function modifyHybridMonitorNamespaceWithOptions(request: ModifyHybridMonitorNamespaceRequest, runtime: Util.RuntimeOptions): ModifyHybridMonitorNamespaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.spec)) {
    query['Spec'] = request.spec;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHybridMonitorNamespace',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a namespace.
 *
 * @description This topic provides an example on how to change the data retention period of the `aliyun` namespace to `cms.s1.2xlarge`. The response shows that the namespace is modified.
 *
 * @param request ModifyHybridMonitorNamespaceRequest
 * @return ModifyHybridMonitorNamespaceResponse
 */
async function modifyHybridMonitorNamespace(request: ModifyHybridMonitorNamespaceRequest): ModifyHybridMonitorNamespaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHybridMonitorNamespaceWithOptions(request, runtime);
}

model ModifyHybridMonitorSLSGroupRequest {
  regionId?: string(name='RegionId'),
  SLSGroupConfig?: [ 
    {
      SLSLogstore?: string(name='SLSLogstore', description='The Logstore.

Valid values of N: 1 to 25.

This parameter is required.', example='Logstore-aliyun-all'),
      SLSProject?: string(name='SLSProject', description='The Simple Log Service project.

Valid values of N: 1 to 25.

This parameter is required.', example='aliyun-project'),
      SLSRegion?: string(name='SLSRegion', description='The region ID.

Valid values of N: 1 to 25.

This parameter is required.', example='cn-hangzhou'),
      SLSUserId?: string(name='SLSUserId', description='The member ID.

Valid values of N: 1 to 25.

If you call this operation by using the management account of a resource directory, you can connect the Alibaba Cloud services that are activated for all members in the resource directory to Hybrid Cloud Monitoring. You can use the resource directory to monitor Alibaba Cloud services across enterprise accounts.

> If a member uses CloudMonitor for the first time, you must make sure that the service-linked role AliyunServiceRoleForCloudMonitor is attached to the member. For more information, see [Manage the service-linked role for CloudMonitor](https://help.aliyun.com/document_detail/170423.html).', example='120886317861****'),
    }
  ](name='SLSGroupConfig', description='The configurations of the Logstore group.

Valid values of N: 1 to 25.

This parameter is required.'),
  SLSGroupDescription?: string(name='SLSGroupDescription', description='The description of the Logstore group.'),
  SLSGroupName?: string(name='SLSGroupName', description='The name of the Logstore group.

For information about how to obtain the name of a Logstore group, see [DescribeHybridMonitorSLSGroup](https://help.aliyun.com/document_detail/429526.html).

This parameter is required.', example='Logstore_test'),
}

model ModifyHybridMonitorSLSGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='NotFound.SLSGroup'),
  requestId?: string(name='RequestId', description='The request ID.', example='66683237-7126-50F8-BBF8-D67ACC919A17'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyHybridMonitorSLSGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyHybridMonitorSLSGroupResponseBody(name='body'),
}

/**
 * @summary Modifies a Logstore group.
 *
 * @description In this example, a Logstore group named `Logstore_test` is modified. The Logstore of the `aliyun-project` project in the `cn-hangzhou` region is changed to `Logstore-aliyun-all`. The response shows that the Logstore group is modified.
 *
 * @param request ModifyHybridMonitorSLSGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyHybridMonitorSLSGroupResponse
 */
async function modifyHybridMonitorSLSGroupWithOptions(request: ModifyHybridMonitorSLSGroupRequest, runtime: Util.RuntimeOptions): ModifyHybridMonitorSLSGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.SLSGroupConfig)) {
    query['SLSGroupConfig'] = request.SLSGroupConfig;
  }
  if (!Util.isUnset(request.SLSGroupDescription)) {
    query['SLSGroupDescription'] = request.SLSGroupDescription;
  }
  if (!Util.isUnset(request.SLSGroupName)) {
    query['SLSGroupName'] = request.SLSGroupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHybridMonitorSLSGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a Logstore group.
 *
 * @description In this example, a Logstore group named `Logstore_test` is modified. The Logstore of the `aliyun-project` project in the `cn-hangzhou` region is changed to `Logstore-aliyun-all`. The response shows that the Logstore group is modified.
 *
 * @param request ModifyHybridMonitorSLSGroupRequest
 * @return ModifyHybridMonitorSLSGroupResponse
 */
async function modifyHybridMonitorSLSGroup(request: ModifyHybridMonitorSLSGroupRequest): ModifyHybridMonitorSLSGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHybridMonitorSLSGroupWithOptions(request, runtime);
}

model ModifyHybridMonitorTaskRequest {
  attachLabels?: [ 
    {
      name?: string(name='Name', description='The tag key of the metric.', example='app_service'),
      value?: string(name='Value', description='The tag value of the metric.', example='testValue'),
    }
  ](name='AttachLabels', description='The tags of the metric.'),
  collectInterval?: string(name='CollectInterval', description='The collection period of the metric. Valid values:

*   15
*   60

Unit: seconds.', example='15'),
  description?: string(name='Description', description='The description of the metric import task.'),
  regionId?: string(name='RegionId'),
  SLSProcessConfig?: {
    express?: [ 
      {
        alias?: string(name='Alias', description='The alias of the extended field that specifies the result of basic operations performed on aggregation results.', example='SuccRate'),
        express?: string(name='Express', description='The extended field that specifies the result of basic operations performed on aggregation results.', example='success_count'),
      }
    ](name='Express', description='The extended fields that specify the results of basic operations performed on aggregation results.'),
    filter?: {
      filters?: [ 
        {
          operator?: string(name='Operator', description='The method that is used to filter logs imported from Log Service. Valid values:

*   `contain`: contains
*   `notContain`: does not contain
*   `>`: greater than
*   `<`: less than
*   `=`: equal to
*   `! =`: not equal to
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='='),
          SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to filter logs imported from Log Service.', example='code'),
          value?: string(name='Value', description='The value of the key that is used to filter logs imported from Log Service.', example='200'),
        }
      ](name='Filters', description='None'),
      relation?: string(name='Relation', description='The relationship between multiple filter conditions. Valid values:

*   and (default): Logs are processed only if all filter conditions are met.
*   or: Logs are processed if one of the filter conditions is met.', example='and'),
    }(name='Filter', description='The conditions that are used to filter logs imported from Log Service.'),
    groupBy?: [ 
      {
        alias?: string(name='Alias', description='The alias of the aggregation result.', example='ApiResult'),
        SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Log Service.', example='code'),
      }
    ](name='GroupBy', description='The dimensions based on which data is aggregated. This parameter is equivalent to the GROUP BY clause in SQL.'),
    statistics?: [ 
      {
        alias?: string(name='Alias', description='The alias of the aggregation result.', example='level_count'),
        function?: string(name='Function', description='The function that is used to aggregate the log data of a statistical period. Valid values:

*   count: counts the number.
*   sum: calculates the total value.
*   avg: calculates the average value.
*   max: calculates the maximum value.
*   min: calculates the minimum value.
*   value: collects samples within the statistical period.
*   countps: calculates the counted number of the specified field divided by the total number of seconds within the statistical period.
*   sumps: calculates the total value of the specified field divided by the total number of seconds within the statistical period.
*   distinct: counts the number of logs where the specified field appears within the statistical period.
*   distribution: counts the number of logs that meet a specified condition within the statistical period.
*   percentile: sorts the values of the specified field in ascending order, and then returns the value that is at the specified percentile within the statistical period. Example: P50.', example='count'),
        parameter1?: string(name='Parameter1', description='The value of the function that is used to aggregate logs imported from Log Service.

*   If the `Function` parameter is set to `distribution`, this parameter specifies the lower limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 200.
*   If you set the `Function` parameter to `percentile`, this parameter specifies the percentile at which the expected value is. For example, 0.5 specifies P50.', example='200'),
        parameter2?: string(name='Parameter2', description='The value of the function that is used to aggregate logs imported from Log Service.

> This parameter must be specified when `Function` is set to `distribution`. This parameter specifies the upper limit of the statistical interval. For example, if you want to calculate the number of HTTP requests whose status code is 2XX, set this parameter to 299.', example='299'),
        SLSKeyName?: string(name='SLSKeyName', description='The name of the key that is used to aggregate logs imported from Log Service.', example='name'),
      }
    ](name='Statistics', description='None'),
  }(name='SLSProcessConfig', description='The configurations of the logs that are imported from Log Service.'),
  taskId?: string(name='TaskId', description='The ID of the metric import task.

For information about how to obtain the ID of a metric import task, see [DescribeHybridMonitorTaskList](https://help.aliyun.com/document_detail/428624.html).

This parameter is required.', example='36****'),
  taskName?: string(name='TaskName', description='The name of the metric import task.

For information about how to obtain the ID of a metric import task, see [DescribeHybridMonitorTaskList](https://help.aliyun.com/document_detail/428624.html).', example='SLS_task'),
}

model ModifyHybridMonitorTaskResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='Invalid.SLSConfig'),
  requestId?: string(name='RequestId', description='The request ID.', example='11145B76-566A-5D80-A8A3-FAD98D310079'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyHybridMonitorTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyHybridMonitorTaskResponseBody(name='body'),
}

/**
 * @summary Modifies a metric for the logs that are imported from Log Service.
 *
 * @description This topic provides an example on how to change the collection period of a metric import task whose ID is `36****` to `15` seconds. The task is used to monitor the logs that are imported from Log Service. The returned result indicates that the metric is modified.
 *
 * @param request ModifyHybridMonitorTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyHybridMonitorTaskResponse
 */
async function modifyHybridMonitorTaskWithOptions(request: ModifyHybridMonitorTaskRequest, runtime: Util.RuntimeOptions): ModifyHybridMonitorTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.attachLabels)) {
    query['AttachLabels'] = request.attachLabels;
  }
  if (!Util.isUnset(request.collectInterval)) {
    query['CollectInterval'] = request.collectInterval;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.SLSProcessConfig)) {
    query['SLSProcessConfig'] = request.SLSProcessConfig;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHybridMonitorTask',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a metric for the logs that are imported from Log Service.
 *
 * @description This topic provides an example on how to change the collection period of a metric import task whose ID is `36****` to `15` seconds. The task is used to monitor the logs that are imported from Log Service. The returned result indicates that the metric is modified.
 *
 * @param request ModifyHybridMonitorTaskRequest
 * @return ModifyHybridMonitorTaskResponse
 */
async function modifyHybridMonitorTask(request: ModifyHybridMonitorTaskRequest): ModifyHybridMonitorTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHybridMonitorTaskWithOptions(request, runtime);
}

model ModifyMetricRuleBlackListRequest {
  category?: string(name='Category', description='The category of the cloud service. For example, ApsaraDB for Redis supports the standard architecture, the cluster architecture, and the read/write splitting architecture. In this case, the valid values of this parameter for ApsaraDB for Redis include `kvstore_standard`, `kvstore_sharding`, and `kvstore_splitrw`.

This parameter is required.', example='ecs'),
  effectiveTime?: string(name='EffectiveTime', description='The time range within which the blacklist policy is effective. Take note of the following information:

*   If you do not configure this parameter, the blacklist policy is permanently effective.

*   If you configure this parameter, the blacklist policy is effective only within the specified time range. Examples:

    *   `03:00-04:59`: The blacklist policy is effective from 03:00 to 05:00 local time. 05:00 local time is excluded.
    *   `03:00-04:59 UTC+0700`: The blacklist policy is effective from 03:00 to 05:00 (UTC+7). 05:00 (UTC+7) is excluded.', example='03:00-04:59'),
  enableEndTime?: string(name='EnableEndTime', description='The timestamp when the blacklist policy expires.

Unit: milliseconds.', example='1640608200000'),
  enableStartTime?: string(name='EnableStartTime', description='The timestamp when the blacklist policy starts to take effect.

Unit: milliseconds.', example='1640237400000'),
  id?: string(name='Id', description='The ID of the blacklist policy.

For information about how to obtain the ID of a blacklist policy, see [DescribeMetricRuleBlackList](https://help.aliyun.com/document_detail/457257.html).

This parameter is required.', example='93514c96-ceb8-47d8-8ee3-93b6d98b****'),
  instances?: [ string ](name='Instances', description='The IDs of the instances that belong to the specified cloud service.

This parameter is required.'),
  metrics?: [ 
    {
      metricName?: string(name='MetricName', description='The name of the metric.

Valid values of N: 1 to 10.

This parameter is required.', example='disk_utilization'),
      resource?: string(name='Resource', description='The extended dimension of the instance. For example, `{"device":"C:"}` specifies that the blacklist policy is applied to all C disks of the specified Elastic Compute Service (ECS) instance.

Valid values of N: 1 to 10.', example='{"device":"C:"}'),
    }
  ](name='Metrics', description='The metrics of the instance.

*   If you do not configure this parameter, the blacklist policy applies to all metrics of the specified cloud service.
*   If you configure this parameter, the blacklist policy applies only to the current metric.'),
  name?: string(name='Name', description='The name of the blacklist policy.

This parameter is required.', example='Blacklist-02'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  regionId?: string(name='RegionId'),
  scopeType?: string(name='ScopeType', description='The effective scope of the blacklist policy. Valid values:

*   USER: The blacklist policy takes effect only within the current Alibaba Cloud account.
*   GROUP (default): The blacklist policy takes effect only within the specified application group. For information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).', example='USER'),
  scopeValue?: string(name='ScopeValue', description='The IDs of the application groups.

>  This parameter is required only when `ScopeType` is set to `GROUP`.', example='["67****","78****"]'),
}

model ModifyMetricRuleBlackListResponseBody = {
  code?: string(name='Code', description='The error code.

> The status code 200 indicates that the request was successful.', example='200'),
  count?: string(name='Count', description='The number of blacklist policies that are modified.', example='1'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='008773AE-1D86-3231-90F9-1AF7F808F9CE'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyMetricRuleBlackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMetricRuleBlackListResponseBody(name='body'),
}

/**
 * @summary Modifies a blacklist policy.
 *
 * @param request ModifyMetricRuleBlackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMetricRuleBlackListResponse
 */
async function modifyMetricRuleBlackListWithOptions(request: ModifyMetricRuleBlackListRequest, runtime: Util.RuntimeOptions): ModifyMetricRuleBlackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.effectiveTime)) {
    query['EffectiveTime'] = request.effectiveTime;
  }
  if (!Util.isUnset(request.enableEndTime)) {
    query['EnableEndTime'] = request.enableEndTime;
  }
  if (!Util.isUnset(request.enableStartTime)) {
    query['EnableStartTime'] = request.enableStartTime;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.instances)) {
    query['Instances'] = request.instances;
  }
  if (!Util.isUnset(request.metrics)) {
    query['Metrics'] = request.metrics;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.scopeType)) {
    query['ScopeType'] = request.scopeType;
  }
  if (!Util.isUnset(request.scopeValue)) {
    query['ScopeValue'] = request.scopeValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMetricRuleBlackList',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a blacklist policy.
 *
 * @param request ModifyMetricRuleBlackListRequest
 * @return ModifyMetricRuleBlackListResponse
 */
async function modifyMetricRuleBlackList(request: ModifyMetricRuleBlackListRequest): ModifyMetricRuleBlackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMetricRuleBlackListWithOptions(request, runtime);
}

model ModifyMetricRuleTemplateRequest {
  alertTemplates?: [ 
    {
      escalations?: {
        critical?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Critical'),
        info?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Info'),
        warn?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Warn'),
      }(name='Escalations'),
      category?: string(name='Category', description='The abbreviation of the cloud service name.

Valid values of N: 1 to 200.

For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.', example='ecs'),
      metricName?: string(name='MetricName', description='The metric name.

Valid values of N: 1 to 200.

For information about how to obtain metrics, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.

Valid values of N: 1 to 200.

For information about how to obtain the namespace of a cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
      period?: int32(name='Period', description='The statistical period of the monitoring data.

Valid values of N: 1 to 200.

> If the value is set to 300 seconds, the monitoring data is collected every 300 seconds. If the monitoring data is reported every 1 minute, the alert system calculates the average, maximum, and minimum values of the monitoring data of 5 minutes and checks whether the aggregated values exceed the threshold. To prevent unexpected alerts, we recommend that you set this parameter together with other parameters.', example='60'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.

Valid values of N: 1 to 200.', example='rule1'),
      selector?: string(name='Selector', description='The dimension of the alert. It is an extended field.

Valid values of N: 1 to 200.

For example, an alert template is applied to an application group, this parameter is set to `{"disk":"/"}`, and the MetricName parameter is set to `DiskUtilization`. In this case, the generated alert rule is applied to the root disk partition (`"/"`) of all instances in the application group to which the alert template is applied.

> For more information about the values of extended fields, see [DescribeMetricRuleTemplateAttribute](https://help.aliyun.com/document_detail/114979.html).', example='{"disk":"/"}'),
      webhook?: string(name='Webhook', description='The callback URL.

Valid values of N: 1 to 200.

The callback URL must be accessible over the Internet. CloudMonitor pushes an alert notification to the specified callback URL by sending an HTTP POST request. Only the HTTP protocol is supported.', example='https://apiwebhook.hipac.cn/api/v1/alarm/aly/eregfeeferrtbnmkdszp'),
    }
  ](name='AlertTemplates', description='The details of the alert template.'),
  description?: string(name='Description', description='The description of the alert template.', example='ECS_template1'),
  name?: string(name='Name', description='The name of the alert template.

For information about how to obtain the name of an alert template, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).', example='test123'),
  regionId?: string(name='RegionId'),
  restVersion?: long(name='RestVersion', description='The version of the alert template. The version changes with the number of times that the alert template is modified.

For information about how to obtain the version of an alert template, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).

This parameter is required.', example='0'),
  templateId?: long(name='TemplateId', description='The ID of the alert template.

For information about how to obtain the ID of an alert template, see [DescribeMetricRuleTemplateList](https://help.aliyun.com/document_detail/114982.html).

This parameter is required.', example='123456'),
}

model ModifyMetricRuleTemplateResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9E07117F-F6AE-4F1C-81E8-36FBB4892235'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifyMetricRuleTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMetricRuleTemplateResponseBody(name='body'),
}

/**
 * @summary Modifies an alert template.
 *
 * @description This topic provides an example on how to modify an alert template whose version is `1` and ID is `123456`. The alert level is changed to `Critical`. The statistical method is changed to `Average`. The alert threshold comparator is changed to `GreaterThanOrEqualToThreshold`. The alert threshold is changed to `90`. The number of alert retries is changed to `3`. The response shows that the alert template is modified.
 *
 * @param request ModifyMetricRuleTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMetricRuleTemplateResponse
 */
async function modifyMetricRuleTemplateWithOptions(request: ModifyMetricRuleTemplateRequest, runtime: Util.RuntimeOptions): ModifyMetricRuleTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alertTemplates)) {
    query['AlertTemplates'] = request.alertTemplates;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.restVersion)) {
    query['RestVersion'] = request.restVersion;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMetricRuleTemplate',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies an alert template.
 *
 * @description This topic provides an example on how to modify an alert template whose version is `1` and ID is `123456`. The alert level is changed to `Critical`. The statistical method is changed to `Average`. The alert threshold comparator is changed to `GreaterThanOrEqualToThreshold`. The alert threshold is changed to `90`. The number of alert retries is changed to `3`. The response shows that the alert template is modified.
 *
 * @param request ModifyMetricRuleTemplateRequest
 * @return ModifyMetricRuleTemplateResponse
 */
async function modifyMetricRuleTemplate(request: ModifyMetricRuleTemplateRequest): ModifyMetricRuleTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMetricRuleTemplateWithOptions(request, runtime);
}

model ModifyMonitorGroupRequest {
  contactGroups?: string(name='ContactGroups', description='The alert groups that can receive alert notifications for the application group.', example='alarm_ecs_group'),
  groupId?: string(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  groupName?: string(name='GroupName', description='The name of the application group.', example='ecs_group'),
  regionId?: string(name='RegionId'),
}

model ModifyMonitorGroupResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C85A2870-5DF4-4269-BC50-ECB5E4591A80'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model ModifyMonitorGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMonitorGroupResponseBody(name='body'),
}

/**
 * @param request ModifyMonitorGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMonitorGroupResponse
 */
async function modifyMonitorGroupWithOptions(request: ModifyMonitorGroupRequest, runtime: Util.RuntimeOptions): ModifyMonitorGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMonitorGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyMonitorGroupRequest
 * @return ModifyMonitorGroupResponse
 */
async function modifyMonitorGroup(request: ModifyMonitorGroupRequest): ModifyMonitorGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMonitorGroupWithOptions(request, runtime);
}

model ModifyMonitorGroupInstancesRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='12345'),
  instances?: [ 
    {
      category?: string(name='Category', description='The abbreviation of the name of the service to which the instances to be added to the application group belong. Valid values:

*   ECS: Elastic Compute Service (ECS) instances provided by Alibaba Cloud and hosts not provided by Alibaba Cloud

*   RDS: ApsaraDB for RDS

*   ADS: AnalyticDB

*   SLB: Server Load Balancer (SLB)

*   VPC: Virtual Private Cloud (VPC)

*   APIGATEWAY: API Gateway

*   CDN: Alibaba Cloud Content Delivery Network (CDN)

*   CS: Container Service for Swarm

*   DCDN: Dynamic Route for CDN

*   DDoS: Anti-DDoS Pro

*   EIP: Elastic IP Address (EIP)

*   ELASTICSEARCH: Elasticsearch

*   EMR: E-MapReduce

*   ESS: Auto Scaling

*   HBASE: ApsaraDB for Hbase

*   IOT_EDGE: IoT Edge

*   K8S_POD: pods in Container Service for Kubernetes

*   KVSTORE_SHARDING: ApsaraDB for Redis of the cluster architecture

*   KVSTORE_SPLITRW: ApsaraDB for Redis of the read/write splitting architecture

*   KVSTORE_STANDARD: ApsaraDB for Redis of the standard architecture

*   MEMCACHE: ApsaraDB for Memcache

*   MNS: Message Service (MNS)

*   MONGODB: ApsaraDB for MongoDB of the replica set architecture

*   MONGODB_CLUSTER: ApsaraDB for MongoDB of the cluster architecture

*   MONGODB_SHARDING: ApsaraDB for MongoDB of the sharded cluster architecture

*   MQ_TOPIC: MNS topics

*   OCS: ApsaraDB for Memcache of earlier versions

*   OPENSEARCH: Open Search

*   OSS: Object Storage Service (OSS)

*   POLARDB: PolarDB

*   PETADATA: HybridDB for MySQL

*   SCDN: Secure Content Delivery Network (SCDN)

*   SHAREBANDWIDTHPACKAGES: EIP Bandwidth Plan

*   SLS: Log Service

*   VPN: VPN Gateway

    Valid values of N: 1 to 2000.

This parameter is required.', example='ECS'),
      instanceId?: string(name='InstanceId', description='The ID of the instance. Valid values of N: 1 to 2000.

This parameter is required.', example='i-a2d5q7pm12****'),
      instanceName?: string(name='InstanceName', description='The name of the instance. Valid values of N: 1 to 2000.

This parameter is required.', example='HostName'),
      regionId?: string(name='RegionId', description='The ID of the region where the instance resides. Valid values of N: 1 to 2000.

This parameter is required.', example='cn-hangzhou'),
    }
  ](name='Instances', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model ModifyMonitorGroupInstancesResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='FEC7EDB3-9B08-4AC0-A42A-329F5D14B95A'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.', example='true'),
}

model ModifyMonitorGroupInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMonitorGroupInstancesResponseBody(name='body'),
}

/**
 * @param request ModifyMonitorGroupInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMonitorGroupInstancesResponse
 */
async function modifyMonitorGroupInstancesWithOptions(request: ModifyMonitorGroupInstancesRequest, runtime: Util.RuntimeOptions): ModifyMonitorGroupInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instances)) {
    query['Instances'] = request.instances;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMonitorGroupInstances',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyMonitorGroupInstancesRequest
 * @return ModifyMonitorGroupInstancesResponse
 */
async function modifyMonitorGroupInstances(request: ModifyMonitorGroupInstancesRequest): ModifyMonitorGroupInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMonitorGroupInstancesWithOptions(request, runtime);
}

model ModifySiteMonitorRequest {
  address?: string(name='Address', description='The URL or IP address that is monitored by the task.', example='http://www.aliyun.com'),
  alertIds?: string(name='AlertIds', description='The ID of the alert rule. You can call the DescribeMetricRuleList operation to query the IDs of existing alert rules in CloudMonitor. For more information, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).', example='49f7c317-7645-4cc9-94fd-ea42e122****'),
  customSchedule?: string(name='CustomSchedule', description='The custom detection period. You can only select a time period from Monday to Sunday for detection.', example='{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"}'),
  interval?: string(name='Interval', description='The interval at which detection requests are sent. Valid values: 1, 5, and 15. Unit: minutes. Default value: 1.', example='1'),
  intervalUnit?: string(name='IntervalUnit', description='The unit of the metric.

Unit: milliseconds.', example='ms'),
  ispCities?: string(name='IspCities', description='The information of the detection points. The value is a JSON array. Example: `[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]`. The values of the `city` field indicate Beijing, Hangzhou, and Qingdao.

> You can call the DescribeSiteMonitorISPCityList operation to query the detection points. For more information, see [DescribeSiteMonitorISPCityList](https://help.aliyun.com/document_detail/115045.html). If you leave this parameter empty, the system randomly selects three detection points.', example='[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]'),
  optionsJson?: string(name='OptionsJson', description='The extended options of the protocol that is used by the site monitoring task. The options vary based on the protocol.', example='{"time_out":5000}'),
  regionId?: string(name='RegionId'),
  taskId?: string(name='TaskId', description='The ID of the site monitoring task.

This parameter is required.', example='2c8dbdf9-a3ab-46a1-85a4-f094965e****'),
  taskName?: string(name='TaskName', description='The name of the site monitoring task. The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_).', example='HanZhou_ECS2'),
}

model ModifySiteMonitorResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  data?: {
    count?: int32(name='count', description='The number of site monitoring tasks.', example='1'),
  }(name='Data', description='The result of modifying the task.'),
  message?: string(name='Message', description='The returned message.', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='68192f5d-0d45-4b98-9724-892813f86c71'),
  success?: string(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model ModifySiteMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySiteMonitorResponseBody(name='body'),
}

/**
 * @summary Modifies a site monitoring task.
 *
 * @description The number of site monitoring tasks.
 *
 * @param request ModifySiteMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySiteMonitorResponse
 */
async function modifySiteMonitorWithOptions(request: ModifySiteMonitorRequest, runtime: Util.RuntimeOptions): ModifySiteMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.alertIds)) {
    query['AlertIds'] = request.alertIds;
  }
  if (!Util.isUnset(request.customSchedule)) {
    query['CustomSchedule'] = request.customSchedule;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.intervalUnit)) {
    query['IntervalUnit'] = request.intervalUnit;
  }
  if (!Util.isUnset(request.ispCities)) {
    query['IspCities'] = request.ispCities;
  }
  if (!Util.isUnset(request.optionsJson)) {
    query['OptionsJson'] = request.optionsJson;
  }
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySiteMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Modifies a site monitoring task.
 *
 * @description The number of site monitoring tasks.
 *
 * @param request ModifySiteMonitorRequest
 * @return ModifySiteMonitorResponse
 */
async function modifySiteMonitor(request: ModifySiteMonitorRequest): ModifySiteMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySiteMonitorWithOptions(request, runtime);
}

model OpenCmsServiceResponseBody = {
  orderId?: string(name='OrderId', description='The ID of the order.', example='211206750270***'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='E5A72B5B-4F44-438C-B68A-147FD5DC53A8'),
}

model OpenCmsServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenCmsServiceResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI OpenCmsService is deprecated
 *
 * @param request OpenCmsServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenCmsServiceResponse
 */
// Deprecated
async function openCmsServiceWithOptions(runtime: Util.RuntimeOptions): OpenCmsServiceResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'OpenCmsService',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI OpenCmsService is deprecated
 *
 * @return OpenCmsServiceResponse
 */
// Deprecated
async function openCmsService(): OpenCmsServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openCmsServiceWithOptions(runtime);
}

model PutContactRequest {
  channels?: {
    aliIM?: string(name='AliIM', description='The TradeManager ID of the alert contact.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.', example='Jim'),
    dingWebHook?: string(name='DingWebHook', description='The webhook URL of the DingTalk chatbot.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.', example='https://oapi.dingtalk.com/robot/send?access_token=7d49515e8ebf21106a80a9cc4bb3d247771305d52fb15d6201234565****'),
    mail?: string(name='Mail', description='The email address of the alert contact. After you add or modify an email address, the recipient receives an email that contains an activation link. The system adds the recipient to the list of alert contacts only after the recipient activates the email address.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.', example='test@aliyun.com'),
    SMS?: string(name='SMS', description='The phone number of the alert contact. After you add or modify a phone number, the recipient receives a text message that contains an activation link. The system adds the recipient to the list of alert contacts only after the recipient activates the phone number.

Specify at least one of the following alert notification targets: email address or webhook URL of the DingTalk chatbot.', example='1333333****'),
  }(name='Channels'),
  contactName?: string(name='ContactName', description='The name of the alert contact.

This parameter is required.', example='Alice'),
  describe?: string(name='Describe', description='The description of the alert contact.

This parameter is required.', example='ECS_Instance'),
  lang?: string(name='Lang', description='The language in which the alert information is displayed. Valid values:

*   zh-cn: simplified Chinese
*   en: English

>  If you do not specify a value for this parameter, Cloud Monitor identifies the language of the alert information based on the region of your Alibaba Cloud account.', example='zh-cn'),
}

model PutContactResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='181C406E-9DE4-484C-9C61-37AE9A1A12EE'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model PutContactResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutContactResponseBody(name='body'),
}

/**
 * @param request PutContactRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutContactResponse
 */
async function putContactWithOptions(request: PutContactRequest, runtime: Util.RuntimeOptions): PutContactResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactName)) {
    query['ContactName'] = request.contactName;
  }
  if (!Util.isUnset(request.describe)) {
    query['Describe'] = request.describe;
  }
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.channels)) {
    query['Channels'] = request.channels;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutContact',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request PutContactRequest
 * @return PutContactResponse
 */
async function putContact(request: PutContactRequest): PutContactResponse {
  var runtime = new Util.RuntimeOptions{};
  return putContactWithOptions(request, runtime);
}

model PutContactGroupRequest {
  contactGroupName?: string(name='ContactGroupName', description='The name of the alert contact group.

For information about how to obtain the name of an alert contact group, see [DescribeContactGroupList](https://help.aliyun.com/document_detail/114922.html).

This parameter is required.', example='ECS_Group'),
  contactNames?: [ string ](name='ContactNames', example='Alice'),
  describe?: string(name='Describe', description='The description of the alert contact group.', example='ECS_Alert_Group'),
  enableSubscribed?: boolean(name='EnableSubscribed', description='Specifies whether to enable the weekly report subscription feature. Valid values:

*   true: The weekly report subscription feature is enabled.
*   false: The weekly report subscription feature is disabled.

>  You can enable the weekly report subscription only for an Alibaba Cloud account that has at least five Elastic Compute Service (ECS) instances.', example='true'),
}

model PutContactGroupResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='Illegal parameters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B4E30DB6-F069-5D0B-A589-2A89F7D62A57'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model PutContactGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutContactGroupResponseBody(name='body'),
}

/**
 * @summary 添加或者修改报警联系人组
 *
 * @description This topic provides an example on how to create an alert contact group named `ECS_Group`.
 *
 * @param request PutContactGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutContactGroupResponse
 */
async function putContactGroupWithOptions(request: PutContactGroupRequest, runtime: Util.RuntimeOptions): PutContactGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroupName)) {
    query['ContactGroupName'] = request.contactGroupName;
  }
  if (!Util.isUnset(request.contactNames)) {
    query['ContactNames'] = request.contactNames;
  }
  if (!Util.isUnset(request.describe)) {
    query['Describe'] = request.describe;
  }
  if (!Util.isUnset(request.enableSubscribed)) {
    query['EnableSubscribed'] = request.enableSubscribed;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutContactGroup',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 添加或者修改报警联系人组
 *
 * @description This topic provides an example on how to create an alert contact group named `ECS_Group`.
 *
 * @param request PutContactGroupRequest
 * @return PutContactGroupResponse
 */
async function putContactGroup(request: PutContactGroupRequest): PutContactGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return putContactGroupWithOptions(request, runtime);
}

model PutCustomEventRequest {
  eventInfo?: [ 
    {
      content?: string(name='Content', description='The event content. Valid values of N: 1 to 50.

This parameter is required.', example='IOException'),
      eventName?: string(name='EventName', description='The event name. Valid values of N: 1 to 50.

This parameter is required.', example='myEvent'),
      groupId?: string(name='GroupId', description='The ID of the application group. Valid values of N: 1 to 50.

Default value: 0. This value indicates that the event to be reported does not belong to any application group.', example='123456'),
      time?: string(name='Time', description='The time when the event occurred.

Format: `yyyyMMddTHHmmss.SSSZ`.

Valid values of N: 1 to 50.

>  You can also specify a UNIX timestamp. Example: 1552199984000. Unit: milliseconds.', example='20171013T170923.456+0800'),
    }
  ](name='EventInfo', description='The event details.

This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model PutCustomEventResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='131DD9C8-9A32-4428-AD2E-4E3013B6E3A7'),
}

model PutCustomEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutCustomEventResponseBody(name='body'),
}

/**
 * @summary Reports custom events.
 *
 * @param request PutCustomEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutCustomEventResponse
 */
async function putCustomEventWithOptions(request: PutCustomEventRequest, runtime: Util.RuntimeOptions): PutCustomEventResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eventInfo)) {
    query['EventInfo'] = request.eventInfo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutCustomEvent',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Reports custom events.
 *
 * @param request PutCustomEventRequest
 * @return PutCustomEventResponse
 */
async function putCustomEvent(request: PutCustomEventRequest): PutCustomEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return putCustomEventWithOptions(request, runtime);
}

model PutCustomEventRuleRequest {
  contactGroups?: string(name='ContactGroups', description='The alert contact group that receives alert notifications. Separate multiple contact groups with commas (,).

This parameter is required.', example='ECS_Group'),
  effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective. Valid values: 00:00 to 23:59.', example='00:00-23:59'),
  emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.'),
  eventName?: string(name='EventName', description='The name of the custom event. For more information about how to obtain the event name, see [DescribeCustomEventAttribute](https://help.aliyun.com/document_detail/115262.html).

This parameter is required.', example='HostDown'),
  groupId?: string(name='GroupId', description='The ID of the application group. For more information about how to obtain the group ID, see [DescribeCustomEventAttribute](https://help.aliyun.com/document_detail/115262.html).

>  The value 0 indicates that the reported custom event does not belong to any application Group.

This parameter is required.', example='7378****'),
  level?: string(name='Level', description='The level of the alert. Valid values:

*   CRITICAL: critical issue
*   WARN: warning
*   INFO: information

This parameter is required.', example='CRITICAL'),
  period?: string(name='Period', description='The cycle that is used to aggregate monitoring data of the custom event. Unit: seconds. Set the value to an integral multiple of 60. Default value: 300.', example='60'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

>  You can specify an existing ID to modify the corresponding alert rule or specify a new ID to create an alert rule.

This parameter is required.', example='CustomRuleId1'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

This parameter is required.', example='CustomeRule'),
  threshold?: string(name='Threshold', description='The alert threshold.

This parameter is required.', example='99'),
  webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='https://www.aliyun.com'),
}

model PutCustomEventRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The value 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The request has failed due to a temporary failure of the server.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='AD5DCD82-BD1C-405F-BAED-32302DE9F498'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model PutCustomEventRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutCustomEventRuleResponseBody(name='body'),
}

/**
 * @description Before you call this operation, call the PutCustomEvent operation to report the monitoring data of the custom event. For more information, see [PutCustomEvent](https://help.aliyun.com/document_detail/115012.html).
 *
 * @param request PutCustomEventRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutCustomEventRuleResponse
 */
async function putCustomEventRuleWithOptions(request: PutCustomEventRuleRequest, runtime: Util.RuntimeOptions): PutCustomEventRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.effectiveInterval)) {
    query['EffectiveInterval'] = request.effectiveInterval;
  }
  if (!Util.isUnset(request.emailSubject)) {
    query['EmailSubject'] = request.emailSubject;
  }
  if (!Util.isUnset(request.eventName)) {
    query['EventName'] = request.eventName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  if (!Util.isUnset(request.webhook)) {
    query['Webhook'] = request.webhook;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutCustomEventRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description Before you call this operation, call the PutCustomEvent operation to report the monitoring data of the custom event. For more information, see [PutCustomEvent](https://help.aliyun.com/document_detail/115012.html).
 *
 * @param request PutCustomEventRuleRequest
 * @return PutCustomEventRuleResponse
 */
async function putCustomEventRule(request: PutCustomEventRuleRequest): PutCustomEventRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putCustomEventRuleWithOptions(request, runtime);
}

model PutCustomMetricRequest {
  metricList?: [ 
    {
      dimensions?: string(name='Dimensions', description='The dimensions that specify the resources whose monitoring data you want to query. Valid values of N: 1 to 21.

Set the value to a collection of key-value pairs. Format:`{"Key":"Value"}`.

The key or value must be 1 to 64 bytes in length. Excessive characters are truncated.

The key or value can contain letters, digits, periods (.), hyphens (-), underscores (_), forward slashes (/), and backslashes (\\\\\\\\).

>  Dimensions must be formatted as a JSON string in a specified order.

This parameter is required.', example='{"sampleName1":"value1","sampleName2":"value2"}'),
      groupId?: string(name='GroupId', description='The ID of the application group. Valid values of N: 1 to 21.

>  If the metric does not belong to any application group, enter 0.

This parameter is required.', example='12345'),
      metricName?: string(name='MetricName', description='The name of the metric. Valid values of N: 1 to 21. For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_total'),
      period?: string(name='Period', description='The aggregation period. Valid values of N: 1 to 21. Unit: seconds. Valid values: 60 and 300.

>  If the MetricList.N.Type parameter is set to 1, the MetricList.N.Period parameter is required.', example='60'),
      time?: string(name='Time', description='The timestamp when the metric data is generated. Valid values of N: 1 to 21. The timestamp can be in one of the following formats:

*   The UTC timestamp that is in the YYYY-MM-DDThh:mm:ssZ format. Example: 20171012T132456.888+0800.
*   The UNIX timestamp of the LONG type. Example: 1508136760000.', example='1508136760000'),
      type?: string(name='Type', description='The type of the reported data. Valid values of N: 1 to 21. Valid values:

*   0: reports raw data
*   1: reports aggregate data

>  We recommend that you report aggregate data in both the aggregation periods of 60s and 300s. Otherwise, you cannot query monitoring data in a time span that is more than seven days.

This parameter is required.', example='0'),
      values?: string(name='Values', description='The collection of metric values. Valid values of N: 1 to 21.

>  If the MetricList.N.Type parameter is set to 0, the keys in this parameter must be set to the specified value. CloudMonitor aggregates raw data in each aggregation period to generate multiple statistical values, such as the maximum value, the count, and the total value.

This parameter is required.', example='{"value":10.5}'),
    }
  ](name='MetricList', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model PutCustomMetricResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The request has failed due to a temporary failure of the server.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='05B36C2C-5F6E-48D5-8B41-CE36DD7EE8E0'),
}

model PutCustomMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutCustomMetricResponseBody(name='body'),
}

/**
 * @description >  We recommend that you call the [PutHybridMonitorMetricData](https://help.aliyun.com/document_detail/383455.html) operation of Hybrid Cloud Monitoring to report monitoring data.
 *
 * @param request PutCustomMetricRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutCustomMetricResponse
 */
async function putCustomMetricWithOptions(request: PutCustomMetricRequest, runtime: Util.RuntimeOptions): PutCustomMetricResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.metricList)) {
    query['MetricList'] = request.metricList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutCustomMetric',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description >  We recommend that you call the [PutHybridMonitorMetricData](https://help.aliyun.com/document_detail/383455.html) operation of Hybrid Cloud Monitoring to report monitoring data.
 *
 * @param request PutCustomMetricRequest
 * @return PutCustomMetricResponse
 */
async function putCustomMetric(request: PutCustomMetricRequest): PutCustomMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  return putCustomMetricWithOptions(request, runtime);
}

model PutCustomMetricRuleRequest {
  comparisonOperator?: string(name='ComparisonOperator', description='The comparison operator before the threshold. Valid values:

*   `>=`
*   `=`
*   `<=`
*   `>`
*   `<`
*   `!=`

This parameter is required.', example='>='),
  contactGroups?: string(name='ContactGroups', description='The alert group that receives alert notifications. Separate multiple alert groups with commas (,).

This parameter is required.', example='ECS_Group'),
  effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective. Valid values: 00:00 to 23:59.', example='00:00-23:59'),
  emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.'),
  evaluationCount?: int32(name='EvaluationCount', description='The consecutive number of times for which the metric value is measured before an alert is triggered.

This parameter is required.', example='3'),
  groupId?: string(name='GroupId', description='The ID of the application group to which the custom monitoring data belongs.

>  The value 0 indicates that the reported custom monitoring data does not belong to an application group.', example='7378****'),
  level?: string(name='Level', description='The level of the alert. Valid values:

*   CRITICAL
*   WARN
*   INFO

This parameter is required.', example='CRITICAL'),
  metricName?: string(name='MetricName', description='The name of the metric.

>  For more information about how to obtain the metric name, see [DescribeCustomMetricList](https://help.aliyun.com/document_detail/115005.html).

This parameter is required.', example='cpu_total'),
  period?: string(name='Period', description='The cycle that is used to aggregate custom monitoring data. Unit: seconds. Set the value to an integral multiple of 60. The original reporting cycle of custom monitoring data is used by default.', example='300'),
  resources?: string(name='Resources', description='The custom monitoring data to which the alert rule applies. The value includes the application group ID to which the custom monitoring data belongs and the dimension to which the metric belongs.

This parameter is required.', example='[{"groupId":7378****,"dimension":"instanceId=i-hp3543t5e4sudb3s****"}]'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

>  You can specify an existing ID to modify the corresponding alert rule or specify a new ID to create an alert rule.

This parameter is required.', example='MyRuleId1'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.', example='CpuUsage'),
  silenceTime?: int32(name='SilenceTime', description='The mute period during which notifications are not repeatedly sent for an alert. Unit: seconds. Default value: 86400. The default value indicates one day.

>  Only one alert notification is sent during each mute period even if the metric value consecutively exceeds the alert threshold several times.', example='86400'),
  statistics?: string(name='Statistics', description='The method that is used to calculate the metric values that trigger alerts.

This parameter is required.', example='Average'),
  threshold?: string(name='Threshold', description='The threshold of the metric value.

This parameter is required.', example='90'),
  webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='https://www.aliyun.com'),
}

model PutCustomMetricRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The value 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the call was successful, the return value is null. If the call failed, an error message is returned.', example='ComparisonOperator is mandatory for this action.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='65D50468-ECEF-48F1-A6E1-D952E89D9432'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model PutCustomMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutCustomMetricRuleResponseBody(name='body'),
}

/**
 * @description Before you call this operation, call the PutCustomMetric operation to report custom monitoring data. For more information, see [PutCustomMetric](https://help.aliyun.com/document_detail/115004.html).
 *
 * @param request PutCustomMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutCustomMetricRuleResponse
 */
async function putCustomMetricRuleWithOptions(request: PutCustomMetricRuleRequest, runtime: Util.RuntimeOptions): PutCustomMetricRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.comparisonOperator)) {
    query['ComparisonOperator'] = request.comparisonOperator;
  }
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.effectiveInterval)) {
    query['EffectiveInterval'] = request.effectiveInterval;
  }
  if (!Util.isUnset(request.emailSubject)) {
    query['EmailSubject'] = request.emailSubject;
  }
  if (!Util.isUnset(request.evaluationCount)) {
    query['EvaluationCount'] = request.evaluationCount;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.statistics)) {
    query['Statistics'] = request.statistics;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }
  if (!Util.isUnset(request.webhook)) {
    query['Webhook'] = request.webhook;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutCustomMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description Before you call this operation, call the PutCustomMetric operation to report custom monitoring data. For more information, see [PutCustomMetric](https://help.aliyun.com/document_detail/115004.html).
 *
 * @param request PutCustomMetricRuleRequest
 * @return PutCustomMetricRuleResponse
 */
async function putCustomMetricRule(request: PutCustomMetricRuleRequest): PutCustomMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putCustomMetricRuleWithOptions(request, runtime);
}

model PutEventRuleRequest {
  description?: string(name='Description', description='The description of the event-triggered alert rule.'),
  eventPattern?: [ 
    {
      customFilters?: string(name='CustomFilters', description='The keyword that is used to filter events. If the content of an event contains the specified keyword, an alert is automatically triggered.', example='Stopping'),
      eventTypeList?: [ string ](name='EventTypeList', example='Exception'),
      levelList?: [ string ](name='LevelList', example='CRITICAL'),
      nameList?: [ string ](name='NameList', example='Agent_Status_Stopped'),
      product?: string(name='Product', description='The type of the cloud service. Valid values of N: 1 to 50.

>  You can call the DescribeSystemEventMetaList operation to query the cloud services that support event-triggered alerts. For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).

This parameter is required.', example='ecs'),
      SQLFilter?: string(name='SQLFilter', description='The SQL condition that is used to filter events. If the content of an event meets the specified SQL condition, an alert is automatically triggered.

>  The syntax of SQL event filtering is consistent with the query syntax of Log Service.', example='192.168.XX.XX and Executed'),
      statusList?: [ string ](name='StatusList', example='Failed'),
    }
  ](name='EventPattern', description='This parameter is required.'),
  eventType?: string(name='EventType', description='The type of the event-triggered alert rule. Valid values:

*   SYSTEM: system event-triggered alert rule
*   CUSTOM: custom event-triggered alert rule', example='SYSTEM'),
  groupId?: string(name='GroupId', description='The ID of the application group to which the event-triggered alert rule belongs.', example='7378****'),
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the event-triggered alert rule.

This parameter is required.', example='myRuleName'),
  silenceTime?: long(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met. Unit: seconds.', example='86400'),
  state?: string(name='State', description='The status of the event-triggered alert rule. Valid values:

*   ENABLED: enabled
*   DISABLED: disabled', example='ENABLED'),
}

model PutEventRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  data?: string(name='Data', description='The number of event-triggered alert rules that were created or modified.', example='1'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='0B47C47B-E68A-4429-BB23-370E91889C7D'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model PutEventRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutEventRuleResponseBody(name='body'),
}

/**
 * @summary 创建或者修改事件监控
 *
 * @description If the specified rule name does not exist, an event-triggered alert rule is created. If the specified rule name exists, the specified event-triggered alert rule is modified.
 * In this example, the `myRuleName` alert rule is created for the `ecs` cloud service.
 *
 * @param request PutEventRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutEventRuleResponse
 */
async function putEventRuleWithOptions(request: PutEventRuleRequest, runtime: Util.RuntimeOptions): PutEventRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.eventPattern)) {
    query['EventPattern'] = request.eventPattern;
  }
  if (!Util.isUnset(request.eventType)) {
    query['EventType'] = request.eventType;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.state)) {
    query['State'] = request.state;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutEventRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建或者修改事件监控
 *
 * @description If the specified rule name does not exist, an event-triggered alert rule is created. If the specified rule name exists, the specified event-triggered alert rule is modified.
 * In this example, the `myRuleName` alert rule is created for the `ecs` cloud service.
 *
 * @param request PutEventRuleRequest
 * @return PutEventRuleResponse
 */
async function putEventRule(request: PutEventRuleRequest): PutEventRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putEventRuleWithOptions(request, runtime);
}

model PutEventRuleTargetsRequest {
  contactParameters?: [ 
    {
      contactGroupName?: string(name='ContactGroupName', description='The name of the alert contact group. Valid values of N: 1 to 5.'),
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.', example='2'),
      level?: string(name='Level', description='The alert notification methods. Valid values of N: 1 to 5. Valid values:

4: Alert notifications are sent by using DingTalk and emails.', example='3'),
    }
  ](name='ContactParameters', description='The information about the alert contact groups that receive alert notifications.'),
  fcParameters?: [ 
    {
      functionName?: string(name='FunctionName', description='The name of the function. Valid values of N: 1 to 5.', example='fc-test'),
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.', example='1'),
      region?: string(name='Region', description='The region where Function Compute is deployed. Valid values of N: 1 to 5.', example='cn-hangzhou'),
      serviceName?: string(name='ServiceName', description='The name of the Function Compute service. Valid values of N: 1 to 5.', example='fc-test'),
    }
  ](name='FcParameters', description='The information about the recipients in Function Compute.'),
  mnsParameters?: [ 
    {
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.', example='3'),
      queue?: string(name='Queue', description='The name of the SMQ queue. Valid values of N: 1 to 5.', example='queue1'),
      region?: string(name='Region', description='The region for SMQ. Valid values of N: 1 to 5.', example='cn-hangzhou'),
      topic?: string(name='Topic', description='The SMQ topic.', example='topic_sample'),
    }
  ](name='MnsParameters', description='The notifications of Simple Message Queue (formerly MNS) (SMQ).'),
  openApiParameters?: [ 
    {
      action?: string(name='Action', description='The API name.', example='PutLogs'),
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource. Valid values of N: 1 to 5. Format: `arn:acs:${Service}:${Region}:${Account}:${ResourceType}/${ResourceId}`. Fields:

*   Service: the code of a cloud service
*   Region: the region ID
*   Account: the ID of an Alibaba Cloud account
*   ResourceType: the resource type
*   ResourceId: the resource ID'),
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications sent by an API callback.', example='3'),
      jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. Specify the parameters in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
      product?: string(name='Product', description='The ID of the cloud service to which the API operation belongs.', example='log'),
      region?: string(name='Region', description='The region where the resource resides.', example='cn-hangzhou'),
      role?: string(name='Role', description='The name of the role.', example='MyRole'),
      version?: string(name='Version', description='The version of the API.', example='2019-01-01'),
    }
  ](name='OpenApiParameters', description='The parameters of API callback notification.'),
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

This parameter is required.', example='testEventRule'),
  slsParameters?: [ 
    {
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.', example='5'),
      logStore?: string(name='LogStore', description='The name of the Simple Log Service Logstore. Valid values of N: 1 to 5.', example='testlogstore'),
      project?: string(name='Project', description='The name of the Simple Log Service project. Valid values of N: 1 to 5.', example='testproject'),
      region?: string(name='Region', description='The region where Simple Log Service is deployed. Valid values of N: 1 to 5.', example='cn-hangzhou'),
    }
  ](name='SlsParameters', description='The information about the recipients in Simple Log Service.'),
  webhookParameters?: [ 
    {
      id?: string(name='Id', description='The ID of the recipient that receives alert notifications. Valid values of N: 1 to 5.', example='4'),
      method?: string(name='Method', description='The HTTP request method. Valid values of N: 1 to 5.

Valid values: GET and POST.', example='GET'),
      protocol?: string(name='Protocol', description='The name of the protocol. Valid values of N: 1 to 5. Valid values:

*   http
*   telnet
*   ping', example='http'),
      url?: string(name='Url', description='The callback URL. Valid values of N: 1 to 5.', example='http://www.aliyun.com'),
    }
  ](name='WebhookParameters', description='The information about the callback URLs that are used to receive alert notifications.'),
}

model PutEventRuleTargetsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  failedContactParameters?: {
    contactParameter?: [ 
    {
      contactGroupName?: string(name='ContactGroupName', description='The name of the alert contact group.'),
      id?: int32(name='Id', description='The ID of the recipient.', example='2'),
      level?: string(name='Level', description='The alert notification methods. Valid values:

4: Alert notifications are sent by using DingTalk and emails.', example='3'),
    }
  ](name='ContactParameter')
  }(name='FailedContactParameters', description='This parameter is returned if the specified alert contact groups in the request failed to be created or modified.'),
  failedFcParameters?: {
    fcParameter?: [ 
    {
      functionName?: string(name='FunctionName', description='The name of the function.', example='functionTest1'),
      id?: int32(name='Id', description='The ID of the recipient.', example='1'),
      region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
      serviceName?: string(name='ServiceName', description='The name of the Function Compute service.', example='serviceTest1'),
    }
  ](name='FcParameter')
  }(name='FailedFcParameters', description='This parameter is returned if the specified functions in the request failed to be created or modified in Function Compute.'),
  failedMnsParameters?: {
    mnsParameter?: [ 
    {
      id?: int32(name='Id', description='The ID of the recipient.', example='2'),
      queue?: string(name='Queue', description='The name of the MNS queue.', example='testQueue'),
      region?: string(name='Region', description='The region ID.', example='cn-hangzhou'),
    }
  ](name='MnsParameter')
  }(name='FailedMnsParameters', description='This parameter is returned if the specified queues in the request failed to be created or modified in SMQ.'),
  failedParameterCount?: string(name='FailedParameterCount', description='The number of resources that failed to be created or modified.', example='2'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='409C64DA-CF14-45DF-B463-471C790DD15A'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: true and false.', example='true'),
}

model PutEventRuleTargetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutEventRuleTargetsResponseBody(name='body'),
}

/**
 * @summary Adds or modifies the push channels of an event-triggered alert rule.
 *
 * @param request PutEventRuleTargetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutEventRuleTargetsResponse
 */
async function putEventRuleTargetsWithOptions(request: PutEventRuleTargetsRequest, runtime: Util.RuntimeOptions): PutEventRuleTargetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contactParameters)) {
    query['ContactParameters'] = request.contactParameters;
  }
  if (!Util.isUnset(request.fcParameters)) {
    query['FcParameters'] = request.fcParameters;
  }
  if (!Util.isUnset(request.mnsParameters)) {
    query['MnsParameters'] = request.mnsParameters;
  }
  if (!Util.isUnset(request.openApiParameters)) {
    query['OpenApiParameters'] = request.openApiParameters;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.slsParameters)) {
    query['SlsParameters'] = request.slsParameters;
  }
  if (!Util.isUnset(request.webhookParameters)) {
    query['WebhookParameters'] = request.webhookParameters;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutEventRuleTargets',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds or modifies the push channels of an event-triggered alert rule.
 *
 * @param request PutEventRuleTargetsRequest
 * @return PutEventRuleTargetsResponse
 */
async function putEventRuleTargets(request: PutEventRuleTargetsRequest): PutEventRuleTargetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return putEventRuleTargetsWithOptions(request, runtime);
}

model PutExporterOutputRequest {
  configJson?: string(name='ConfigJson', description='The configuration set for exporting monitoring data. It is a JSON object string. The string must include the following fields:

*   endpoint: the endpoint of Log Service.
*   project: the Log Service project to which monitoring data is exported.
*   logstore: the Log Service Logstore to which the monitoring data is exported.
*   ak: the AccessKey ID.
*   as: the AccessKey secret.

This parameter is required.', example='{ "endpoint": "http://cn-qingdao-share.log.aliyuncs.com", "project": "exporter", "logstore": "exporter","ak": "LTAIp*******", "userId": "17754********", "as": "TxHwuJ8yAb3AU******"}'),
  desc?: string(name='Desc', description='The description of the configuration set.', example='Export CPU metrics'),
  destName?: string(name='DestName', description='The name of the configuration set.

This parameter is required.', example='exporterConfig'),
  destType?: string(name='DestType', description='The service to which the monitoring data is exported.', example='sls'),
  regionId?: string(name='RegionId'),
}

model PutExporterOutputResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6A5F022D-AC7C-460E-94AE-B9E75083D027'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. true: The request was successful. false: The request failed.', example='true'),
}

model PutExporterOutputResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutExporterOutputResponseBody(name='body'),
}

/**
 * @summary Creates or modifies a configuration set for exporting monitoring data.
 *
 * @description > The monitoring data can be exported only to Log Service. More services will be supported in the future.
 *
 * @param request PutExporterOutputRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutExporterOutputResponse
 */
async function putExporterOutputWithOptions(request: PutExporterOutputRequest, runtime: Util.RuntimeOptions): PutExporterOutputResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configJson)) {
    query['ConfigJson'] = request.configJson;
  }
  if (!Util.isUnset(request.desc)) {
    query['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.destName)) {
    query['DestName'] = request.destName;
  }
  if (!Util.isUnset(request.destType)) {
    query['DestType'] = request.destType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutExporterOutput',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates or modifies a configuration set for exporting monitoring data.
 *
 * @description > The monitoring data can be exported only to Log Service. More services will be supported in the future.
 *
 * @param request PutExporterOutputRequest
 * @return PutExporterOutputResponse
 */
async function putExporterOutput(request: PutExporterOutputRequest): PutExporterOutputResponse {
  var runtime = new Util.RuntimeOptions{};
  return putExporterOutputWithOptions(request, runtime);
}

model PutExporterRuleRequest {
  describe?: string(name='Describe', description='The description of the data export rule.', example='Export CPU metrics'),
  dstNames?: [ string ](name='DstNames', description='The destination to which the data is exported. Valid values of N: 1 to 20.

This parameter is required.', example='distName1'),
  metricName?: string(name='MetricName', description='The name of the metric.

> 

For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

> For more information, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='acs_ecs_dashboard'),
  regionId?: string(name='RegionId'),
  ruleName?: string(name='RuleName', description='The name of the rule.

> If the specified rule exists, the existing rule is modified. Otherwise, a rule is created.', example='MyRuleName'),
  targetWindows?: string(name='TargetWindows', description='The time window of the exported data. Unit: seconds.

> 

*   Separate multiple time windows with commas (,).

*   Data in a time window of less than 60 seconds cannot be exported.', example='60,300'),
}

model PutExporterRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.', example='success'),
  requestId?: string(name='RequestId', description='The request ID.', example='461CF2CD-2FC3-4B26-8645-7BD27E7D0F1D'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutExporterRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutExporterRuleResponseBody(name='body'),
}

/**
 * @summary Creates or modifies a data export rule.
 *
 * @param request PutExporterRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutExporterRuleResponse
 */
async function putExporterRuleWithOptions(request: PutExporterRuleRequest, runtime: Util.RuntimeOptions): PutExporterRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.describe)) {
    query['Describe'] = request.describe;
  }
  if (!Util.isUnset(request.dstNames)) {
    query['DstNames'] = request.dstNames;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.targetWindows)) {
    query['TargetWindows'] = request.targetWindows;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutExporterRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates or modifies a data export rule.
 *
 * @param request PutExporterRuleRequest
 * @return PutExporterRuleResponse
 */
async function putExporterRule(request: PutExporterRuleRequest): PutExporterRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putExporterRuleWithOptions(request, runtime);
}

model PutGroupMetricRuleRequest {
  escalations?: {
    critical?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Critical-level alerts. Separate multiple statistical methods with commas (,).

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.', example='3'),
    }(name='Critical'),
    info?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Info-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Info-level alerts. Separate multiple statistical methods with commas (,).

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Info-level alerts.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.', example='3'),
    }(name='Info'),
    warn?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid values:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Warn-level alerts. Separate multiple statistical methods with commas (,).

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.', example='3'),
    }(name='Warn'),
  }(name='Escalations'),
  category?: string(name='Category', description='The abbreviation of the cloud service name.

For more information about how to obtain the abbreviation of a cloud service name, see `metricCategory` in the response parameter `Labels` of the [DescribeProjectMeta](https://help.aliyun.com/document_detail/114916.html) operation.', example='ECS'),
  contactGroups?: string(name='ContactGroups', description='The alert contact group.', example='ECS_Group'),
  dimensions?: string(name='Dimensions', description='The first-level dimension of the alert rule in the application group.

Set the value to a set of key-value pairs, for example, `userId:120886317861****` or `instanceId:i-m5e1qg6uo38rztr4****`.', example='[{"instanceId":"i-m5e1qg6uo38rztr4****"}]'),
  effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective.', example='05:31-23:59'),
  emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.'),
  extraDimensionJson?: string(name='ExtraDimensionJson', description='The second-level or third-level dimension of the alert rule in the application group.

Set the value to a set of key-value pairs, for example, `port:80` or `/dev/xvda:d-m5e6yphgzn3aprwu****`.

If the first-level dimension of the alert rule is `instanceId:i-m5e1qg6uo38rztr4****`, its second-level dimension is the `/dev/xvda:d-m5e6yphgzn3aprwu****` disk in the instance.', example='{"/dev/xvda":"d-m5e6yphgzn3aprwu****"}'),
  groupId?: string(name='GroupId', description='The application group ID.

For more information about how to obtain the ID of an application group, see [DescribeMonitorGroups](https://help.aliyun.com/document_detail/115032.html).

This parameter is required.', example='17285****'),
  interval?: string(name='Interval', description='The interval at which CloudMonitor checks whether the alert rule is triggered. Unit: seconds.

>  We recommend that you set the interval to the data aggregation period. If the interval is shorter than the data aggregation period, alerts cannot be triggered due to insufficient data.', example='60'),
  labels?: [ 
    {
      key?: string(name='Key', description='The tag key of the alert rule.', example='key1'),
      value?: string(name='Value', description='The tag value of the alert rule.', example='value1'),
    }
  ](name='Labels', description='The tags of the alert rule.

The specified tag is contained in alert notifications.'),
  metricName?: string(name='MetricName', description='The metric name.

For more information about how to obtain the name of a metric, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service.

For more information about how to obtain the namespace of a cloud service, see [DescribeMetricMetaList](https://help.aliyun.com/document_detail/98846.html) or [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
  noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid values:

*   KEEP_LAST_STATE (default): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.', example='KEEP_LAST_STATE'),
  noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective.', example='00:00-05:30'),
  options?: string(name='Options'),
  period?: string(name='Period', description='The aggregation period of the metric data.

Set the `Period` parameter to an integral multiple of 60. Unit: seconds. Default value: 300.', example='60'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

*   When you create an alert rule for the application group, enter the ID of the alert rule.
*   When you modify a specified alert rule in the application group, you must obtain the ID of the alert rule. For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

This parameter is required.', example='123456'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

*   When you create an alert rule for the application group, enter the name of the alert rule.
*   When you modify a specified alert rule in the application group, you must obtain the name of the alert rule. For more information about how to obtain the name of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

This parameter is required.', example='Rule_01'),
  silenceTime?: int32(name='SilenceTime', description='The mute period during which new alerts are not sent even if the trigger conditions are met.

Unit: seconds. Default value: 86400.', example='86400'),
  webhook?: string(name='Webhook', description='The callback URL.

The callback URL must be accessible over the Internet. CloudMonitor sends a POST request to push an alert notification to the callback URL that you specify. Only HTTP requests are supported.', example='https://www.aliyun.com'),
}

model PutGroupMetricRuleResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The Request is not authorization.'),
  requestId?: string(name='RequestId', description='The request ID.', example='461CF2CD-2FC3-4B26-8645-7BD27E7D0F1D'),
  result?: {
    ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='123456'),
  }(name='Result', description='The result of the request.'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutGroupMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutGroupMetricRuleResponseBody(name='body'),
}

/**
 * @summary Creates or modifies an alert rule for an application group.
 *
 * @description This topic provides an example on how to create an alert rule for the `cpu_total` metric of Elastic Compute Service (ECS) in the `17285****` application group. The ID of the alert rule is `123456`. The name of the alert rule is `Rule_test`. The alert level is `Critical`. The statistical method is `Average`. The alert threshold comparator is `GreaterThanOrEqualToThreshold`. The alert threshold is `90`. The number of alert retries is `3`. The returned result shows that the alert rule is created and the alert rule ID is `123456`.
 *
 * @param request PutGroupMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutGroupMetricRuleResponse
 */
async function putGroupMetricRuleWithOptions(request: PutGroupMetricRuleRequest, runtime: Util.RuntimeOptions): PutGroupMetricRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.dimensions)) {
    query['Dimensions'] = request.dimensions;
  }
  if (!Util.isUnset(request.effectiveInterval)) {
    query['EffectiveInterval'] = request.effectiveInterval;
  }
  if (!Util.isUnset(request.emailSubject)) {
    query['EmailSubject'] = request.emailSubject;
  }
  if (!Util.isUnset(request.extraDimensionJson)) {
    query['ExtraDimensionJson'] = request.extraDimensionJson;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.noDataPolicy)) {
    query['NoDataPolicy'] = request.noDataPolicy;
  }
  if (!Util.isUnset(request.noEffectiveInterval)) {
    query['NoEffectiveInterval'] = request.noEffectiveInterval;
  }
  if (!Util.isUnset(request.options)) {
    query['Options'] = request.options;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.webhook)) {
    query['Webhook'] = request.webhook;
  }
  if (!Util.isUnset(request.escalations)) {
    query['Escalations'] = request.escalations;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutGroupMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates or modifies an alert rule for an application group.
 *
 * @description This topic provides an example on how to create an alert rule for the `cpu_total` metric of Elastic Compute Service (ECS) in the `17285****` application group. The ID of the alert rule is `123456`. The name of the alert rule is `Rule_test`. The alert level is `Critical`. The statistical method is `Average`. The alert threshold comparator is `GreaterThanOrEqualToThreshold`. The alert threshold is `90`. The number of alert retries is `3`. The returned result shows that the alert rule is created and the alert rule ID is `123456`.
 *
 * @param request PutGroupMetricRuleRequest
 * @return PutGroupMetricRuleResponse
 */
async function putGroupMetricRule(request: PutGroupMetricRuleRequest): PutGroupMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putGroupMetricRuleWithOptions(request, runtime);
}

model PutHybridMonitorMetricDataRequest {
  metricList?: [ 
    {
      labels?: [ 
        {
          key?: string(name='Key', description='The tag key of the metric.

Valid values of N: 1 to 100.

The key can contain letters, digits, and underscores (_). The key must start with a letter or an underscore (_).

>  You must specify both the Key and Value parameters.', example='IP'),
          value?: string(name='Value', description='The tag value of the metric.

Valid values of N: 1 to 100.

>  You must specify both the Key and Value parameters.', example='192.168.XX.XX'),
        }
      ](name='Labels', description='The tags of the metric.

Valid values of N: 1 to 100.', example='app、ip、hostName等标识信息'),
      name?: string(name='Name', description='The metric name.

Valid values of N: 1 to 100.

The name can contain letters, digits, and underscores (_). The name must start with a letter.

This parameter is required.', example='CPU_Usage'),
      TS?: long(name='TS', description='The time when the monitoring data is imported. The value is a timestamp.

Valid values of N: 1 to 100.

Unit: milliseconds. By default, the current time is used.', example='1640776119473'),
      value?: string(name='Value', description='The value of the metric.

Valid values of N: 1 to 100.

The value must be an integer or a floating-point number.

This parameter is required.', example='90'),
    }
  ](name='MetricList', description='The monitoring data.

Valid values of N: 1 to 100.

This parameter is required.'),
  namespace?: string(name='Namespace', description='The name of the namespace.

For information about how to obtain the name of a namespace, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='default-aliyun'),
  regionId?: string(name='RegionId'),
}

model PutHybridMonitorMetricDataResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  errorDetail?: [ 
    {
      errorMessage?: string(name='ErrorMessage', description='The error message of the invalid parameter.', example='label name :123 not match [a-zA-Z_][a-zA-Z0-9_]*'),
      index?: long(name='Index', description='The position of the error message in the array.', example='0'),
    }
  ](name='ErrorDetail', description='The details of invalid parameters.

If a request parameter is invalid, the details of the invalid parameter are returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5DB1CBCA-D14A-55FA-814F-B4DBD9735F68'),
}

model PutHybridMonitorMetricDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutHybridMonitorMetricDataResponseBody(name='body'),
}

/**
 * @summary Imports the monitoring data of a metric to a namespace of Hybrid Cloud Monitoring.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Limits
 * The size of the monitoring data that you import at a time must be less than or equal to 1 MB.
 * # [](#)Description
 * This topic provides an example on how to import the monitoring data of the `CPU_Usage` metric to the `default-aliyun` namespace of Hybrid Cloud Monitoring.
 *
 * @param request PutHybridMonitorMetricDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutHybridMonitorMetricDataResponse
 */
async function putHybridMonitorMetricDataWithOptions(request: PutHybridMonitorMetricDataRequest, runtime: Util.RuntimeOptions): PutHybridMonitorMetricDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.metricList)) {
    query['MetricList'] = request.metricList;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutHybridMonitorMetricData',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Imports the monitoring data of a metric to a namespace of Hybrid Cloud Monitoring.
 *
 * @description # [](#)Prerequisites
 * Hybrid Cloud Monitoring is activated. For more information, see [Activate Hybrid Cloud Monitoring](https://help.aliyun.com/document_detail/250773.html).
 * # [](#)Limits
 * The size of the monitoring data that you import at a time must be less than or equal to 1 MB.
 * # [](#)Description
 * This topic provides an example on how to import the monitoring data of the `CPU_Usage` metric to the `default-aliyun` namespace of Hybrid Cloud Monitoring.
 *
 * @param request PutHybridMonitorMetricDataRequest
 * @return PutHybridMonitorMetricDataResponse
 */
async function putHybridMonitorMetricData(request: PutHybridMonitorMetricDataRequest): PutHybridMonitorMetricDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return putHybridMonitorMetricDataWithOptions(request, runtime);
}

model PutLogMonitorRequest {
  aggregates?: [ 
    {
      alias?: string(name='Alias', description='The alias of the aggregate function. Valid values of N: 1 to 10.

This parameter is required.', example='Count'),
      fieldName?: string(name='FieldName', description='The name of the field to be aggregated. Valid values of N: 1 to 10.

This parameter is required.', example='sourceCount'),
      function?: string(name='Function', description='The function that is used to aggregate log data within a statistical period. Valid values of N: 1 to 10. Valid values:

*   count: counts the number.
*   sum: calculates the total value.
*   avg: calculates the average value.
*   max: calculates the maximum value.
*   min: calculates the minimum value.
*   countps: calculates the number of values of the specified field divided by the total number of seconds within a statistical period.
*   sumps: calculates the sum of the values of the specified field divided by the total number of seconds within a statistical period.
*   distinct: calculates the number of unique values of the specified field within a statistical period.

This parameter is required.', example='count'),
    }
  ](name='Aggregates', description='The aggregation logic.

This parameter is required.'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='7301****'),
  groupbys?: [ 
    {
      alias?: string(name='Alias', description='The alias of the dimension based on which the data is grouped. Valid values of N: 1 to 10.', example='CPUUtilization'),
      fieldName?: string(name='FieldName', description='The name of the field that is specified as the dimension. Valid values of N: 1 to 10.', example='cpu'),
    }
  ](name='Groupbys', description='The dimension based on which the data is grouped. This parameter is equivalent to the GROUP BY clause in SQL statements. If no dimension is specified, all data is aggregated based on the aggregate function.'),
  logId?: string(name='LogId', description='The ID of the log monitoring metric.', example='16****'),
  metricExpress?: string(name='MetricExpress', description='The extended field. The extended field allows you to perform basic operations on the aggregation results.

For example, you have calculated TotalNumber and 5XXNumber by aggregating the data. TotalNumber indicates the total number of HTTP requests, and 5XXNumber indicates the number of HTTP requests whose status code is greater than 499. You can calculate the server error rate by adding the following formula to the extended field: 5XXNumber/TotalNumber\\\\*100.

JSON format: {"extend":{"errorPercent":"5XXNumber/TotalNumber\\\\*100"}}. Description:

*   extend: required.
*   errorPercent: the alias of the field generated in the calculation result. You can specify the alias as needed.
*   5XXNumber/TotalNumber\\\\*100: the calculation expression.', example='{"extend":{"errorPercent":"5XXNumber/TotalNumber*100"}}'),
  metricName?: string(name='MetricName', description='The metric name. For more information about the metrics for cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='cpu_total'),
  regionId?: string(name='RegionId'),
  slsLogstore?: string(name='SlsLogstore', description='The name of the Simple Log Service Logstore.

This parameter is required.', example='test-logstore'),
  slsProject?: string(name='SlsProject', description='The name of the Simple Log Service project.

This parameter is required.', example='test-project'),
  slsRegionId?: string(name='SlsRegionId', description='The region in which the Simple Log Service project resides.

This parameter is required.', example='cn-hangzhou'),
  tumblingwindows?: string(name='Tumblingwindows', description='The size of the tumbling window for calculation. Unit: seconds. CloudMonitor performs aggregation for each tumbling window.', example='60,300'),
  unit?: string(name='Unit', description='The unit.', example='Percent'),
  valueFilter?: [ 
    {
      key?: string(name='Key', description='The name of the log field that is used for matching in the filter condition. Valid values of N: 1 to 10.', example='lh_source'),
      operator?: string(name='Operator', description='The method that is used to match the field value. Valid values of N: 1 to 10. Valid values:

*   `contain`: contains
*   `notContain`: does not contain
*   `>`: greater than
*   `<`: less than
*   `>=`: greater than or equal to
*   `<=`: less than or equal to', example='contain'),
      value?: string(name='Value', description='The field value to be matched in the filter condition. Valid values of N: 1 to 10.', example='test'),
    }
  ](name='ValueFilter', description='The condition that is used to filter logs. The ValueFilter and ValueFilterRelation parameters are used in pair. The filter condition is equivalent to the WHERE clause in SQL statements. If no filter condition is specified, all logs are processed. For example, logs contain the Level and Error fields. If you need to calculate the number of times that logs of the Error level appear every minute, you can set the filter condition to Level=Error and count the number of logs that meet this condition.'),
  valueFilterRelation?: string(name='ValueFilterRelation', description='The logical operator that is used between log filter conditions. Valid values:

*   and
*   or

>  The ValueFilterRelation and `ValueFilter.N.Key` parameters must be used in pair.

This parameter is required.', example='and'),
}

model PutLogMonitorResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  logId?: string(name='LogId', description='The ID of the log monitoring metric.', example='16****'),
  message?: string(name='Message', description='The returned message.

*   If the request was successful, `successful` is returned.
*   If the request failed, an error message is returned. Example: `alias of aggreate must be set value.`', example='successful'),
  requestId?: string(name='RequestId', description='The request ID.', example='91561287-0802-5F9C-9BDE-404C50D41B06'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutLogMonitorResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutLogMonitorResponseBody(name='body'),
}

/**
 * @summary Creates or modifies a log monitoring metric.
 *
 * @description In the example of this topic, the `cpu_total` log monitoring metric is created. The response shows that the log monitoring metric is created and the metric ID is `16****`.
 *
 * @param request PutLogMonitorRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutLogMonitorResponse
 */
async function putLogMonitorWithOptions(request: PutLogMonitorRequest, runtime: Util.RuntimeOptions): PutLogMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aggregates)) {
    query['Aggregates'] = request.aggregates;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupbys)) {
    query['Groupbys'] = request.groupbys;
  }
  if (!Util.isUnset(request.logId)) {
    query['LogId'] = request.logId;
  }
  if (!Util.isUnset(request.metricExpress)) {
    query['MetricExpress'] = request.metricExpress;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.slsLogstore)) {
    query['SlsLogstore'] = request.slsLogstore;
  }
  if (!Util.isUnset(request.slsProject)) {
    query['SlsProject'] = request.slsProject;
  }
  if (!Util.isUnset(request.slsRegionId)) {
    query['SlsRegionId'] = request.slsRegionId;
  }
  if (!Util.isUnset(request.tumblingwindows)) {
    query['Tumblingwindows'] = request.tumblingwindows;
  }
  if (!Util.isUnset(request.unit)) {
    query['Unit'] = request.unit;
  }
  if (!Util.isUnset(request.valueFilter)) {
    query['ValueFilter'] = request.valueFilter;
  }
  if (!Util.isUnset(request.valueFilterRelation)) {
    query['ValueFilterRelation'] = request.valueFilterRelation;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutLogMonitor',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates or modifies a log monitoring metric.
 *
 * @description In the example of this topic, the `cpu_total` log monitoring metric is created. The response shows that the log monitoring metric is created and the metric ID is `16****`.
 *
 * @param request PutLogMonitorRequest
 * @return PutLogMonitorResponse
 */
async function putLogMonitor(request: PutLogMonitorRequest): PutLogMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return putLogMonitorWithOptions(request, runtime);
}

model PutMetricRuleTargetsRequest {
  regionId?: string(name='RegionId'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

For information about how to obtain the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

This parameter is required.', example='ae06917_75a8c43178ab66****'),
  targets?: [ 
    {
      arn?: string(name='Arn', description='The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported.

The following part describes the ARN of SMQ and the parameters in the ARN:

`acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message`.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {userId}: the ID of the Alibaba Cloud account that owns the resource.

*   {Resource type}: the type of the resource for which alerts are triggered. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.

ARN of Auto Scaling:

acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}

ARN of Simple Log Service:

acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}

ARN of Function Compute:

acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}

This parameter is required.', example='acs:mns:cn-hangzhou:120886317861****:/queues/test/message'),
      id?: string(name='Id', description='The ID of the resource for which alerts are triggered.

For more information about how to obtain the ID of the resource for which alerts are triggered, see [DescribeMetricRuleTargets](https://help.aliyun.com/document_detail/121592.html).

This parameter is required.', example='1'),
      jsonParams?: string(name='JsonParams', description='The parameters of the alert callback. The parameters are in the JSON format.', example='{"customField1":"value1","customField2":"$.name"}'),
      level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='["INFO", "WARN", "CRITICAL"]'),
    }
  ](name='Targets', description='None.

This parameter is required.'),
}

model PutMetricRuleTargetsResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  failData?: {
    targets?: {
      target?: [ 
      {
        arn?: string(name='Arn', description='The ARN of the resource. Format: `acs:{Service name abbreviation}:{regionId}:{userId}:/{Resource type}/{Resource name}/message`. SMQ, Auto Scaling, Simple Log Service, and Function Compute are supported. Example: `acs:mns:cn-hangzhou:120886317861****:/queues/test123/message`. The following part describes the ARN of SMQ and the parameters in the ARN:

*   {Service name abbreviation}: mns.

*   {userId}: the ID of the Alibaba Cloud account.

*   {regionId}: the region ID of the SMQ queue or topic.

*   {Resource type}: the type of the resource for which alerts are triggered. Valid values:

    *   **queues**
    *   **topics**

*   {Resource name}: the resource name.

    *   If the resource type is **queues**, the resource name is the queue name.
    *   If the resource type is **topics**, the resource name is the topic name.', example='acs:mns:cn-hangzhou:111:/queues/test/message'),
        id?: string(name='Id', description='The ID of the resource for which alerts are triggered.', example='1'),
        level?: string(name='Level', description='The alert level. Valid values:

*   INFO
*   WARN
*   CRITICAL', example='["INFO", "WARN", "CRITICAL"]'),
      }
    ](name='Target')
    }(name='Targets', description='The information about the resources for which alerts are triggered.'),
  }(name='FailData', description='The failed data.'),
  message?: string(name='Message', description='The error message returned.', example='The request processing has failed due to some unknown error.'),
  requestId?: string(name='RequestId', description='The request ID.', example='6A569B0D-9055-58AF-9E82-BAEAF95C0FD5'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true: The request was successful.
*   false: The request failed.', example='true'),
}

model PutMetricRuleTargetsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutMetricRuleTargetsResponseBody(name='body'),
}

/**
 * @summary Adds or modifies the push channels of an alert rule.
 *
 * @description # [](#)
 * This topic provides an example on how to associate an alert rule with a resource. In this example, the alert rule is `ae06917_75a8c43178ab66****`, the resource is `acs:mns:cn-hangzhou:120886317861****:/queues/test/message`, and the ID of the resource for which alerts are triggered is `1`. The response indicates that the resource is associated with the specified alert rule.
 *
 * @param request PutMetricRuleTargetsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutMetricRuleTargetsResponse
 */
async function putMetricRuleTargetsWithOptions(request: PutMetricRuleTargetsRequest, runtime: Util.RuntimeOptions): PutMetricRuleTargetsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.targets)) {
    query['Targets'] = request.targets;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMetricRuleTargets',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Adds or modifies the push channels of an alert rule.
 *
 * @description # [](#)
 * This topic provides an example on how to associate an alert rule with a resource. In this example, the alert rule is `ae06917_75a8c43178ab66****`, the resource is `acs:mns:cn-hangzhou:120886317861****:/queues/test/message`, and the ID of the resource for which alerts are triggered is `1`. The response indicates that the resource is associated with the specified alert rule.
 *
 * @param request PutMetricRuleTargetsRequest
 * @return PutMetricRuleTargetsResponse
 */
async function putMetricRuleTargets(request: PutMetricRuleTargetsRequest): PutMetricRuleTargetsResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMetricRuleTargetsWithOptions(request, runtime);
}

model PutMonitorGroupDynamicRuleRequest {
  groupId?: long(name='GroupId', description='The ID of the application group.

This parameter is required.', example='123456'),
  groupRules?: [ 
    {
      category?: string(name='Category', description='The cloud service to which the alert rule is applied. Valid values of N: 1 to 3. Valid values:

*   ecs: Elastic Compute Service (ECS)
*   rds: ApsaraDB RDS
*   slb: Server Load Balancer (SLB)

This parameter is required.', example='ecs'),
      filterRelation?: string(name='FilterRelation', description='The logical operator used between conditional expressions in the alert rule. Valid values of N: 1 to 3. Valid values:

*   and: The instances that meet all the conditional expressions are automatically added to the application group.
*   or: The instances that meet one of the conditional expressions are automatically added to the application group.

This parameter is required.', example='and'),
      filters?: [ 
        {
          function?: string(name='Function', description='The method that is used to filter instances. Valid values of N: 1 to 3. Valid values:

*   contains: contains
*   notContains: does not contain
*   startWith: starts with a prefix
*   endWith: ends with a suffix

This parameter is required.', example='contains'),
          name?: string(name='Name', description='The name of the field based on which instances are filtered. Valid values of N: 1 to 3.

Only hostnames are supported. Example: hostName.

This parameter is required.', example='hostName'),
          value?: string(name='Value', description='The value to be matched with the specified field. Valid values of N: 1 to 3.

This parameter is required.', example='nginx'),
        }
      ](name='Filters', description='None.

This parameter is required.'),
    }
  ](name='GroupRules', description='None.

This parameter is required.'),
  isAsync?: boolean(name='IsAsync', description='The mode for creating the alert rule. Valid values:

*   true: creates asynchronously
*   false (default): creates synchronously', example='false'),
  regionId?: string(name='RegionId'),
}

model PutMonitorGroupDynamicRuleResponseBody = {
  code?: int32(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='The specified resource is not found.'),
  requestId?: string(name='RequestId', description='The request ID.', example='3E73F1AB-D195-438A-BCA7-2F4355789C58'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutMonitorGroupDynamicRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutMonitorGroupDynamicRuleResponseBody(name='body'),
}

/**
 * @summary Creates or modifies an alert rule to dynamically add instances that meet the rule to an application group.
 *
 * @param request PutMonitorGroupDynamicRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutMonitorGroupDynamicRuleResponse
 */
async function putMonitorGroupDynamicRuleWithOptions(request: PutMonitorGroupDynamicRuleRequest, runtime: Util.RuntimeOptions): PutMonitorGroupDynamicRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupRules)) {
    query['GroupRules'] = request.groupRules;
  }
  if (!Util.isUnset(request.isAsync)) {
    query['IsAsync'] = request.isAsync;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMonitorGroupDynamicRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates or modifies an alert rule to dynamically add instances that meet the rule to an application group.
 *
 * @param request PutMonitorGroupDynamicRuleRequest
 * @return PutMonitorGroupDynamicRuleResponse
 */
async function putMonitorGroupDynamicRule(request: PutMonitorGroupDynamicRuleRequest): PutMonitorGroupDynamicRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMonitorGroupDynamicRuleWithOptions(request, runtime);
}

model PutMonitoringConfigRequest {
  autoInstall?: boolean(name='AutoInstall', description='This parameter is deprecated.', example='true'),
  enableInstallAgentNewECS?: boolean(name='EnableInstallAgentNewECS', description='Specifies whether to automatically install the CloudMonitor agent on new ECS instances. Valid values:

*   true (default): The CloudMonitor agent is automatically installed on new ECS instances.
*   false: The CloudMonitor agent is not automatically installed on new ECS instances.', example='true'),
  regionId?: string(name='RegionId'),
}

model PutMonitoringConfigResponseBody = {
  code?: int32(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='Specified parameter EnableInstallAgentNewECS is not valid.'),
  requestId?: string(name='RequestId', description='The request ID.', example='109C8095-6FAD-4DBB-B013-6ED18CE4C0B1'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutMonitoringConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutMonitoringConfigResponseBody(name='body'),
}

/**
 * @summary Configures global settings for the CloudMonitor agent.
 *
 * @param request PutMonitoringConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutMonitoringConfigResponse
 */
async function putMonitoringConfigWithOptions(request: PutMonitoringConfigRequest, runtime: Util.RuntimeOptions): PutMonitoringConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoInstall)) {
    query['AutoInstall'] = request.autoInstall;
  }
  if (!Util.isUnset(request.enableInstallAgentNewECS)) {
    query['EnableInstallAgentNewECS'] = request.enableInstallAgentNewECS;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutMonitoringConfig',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Configures global settings for the CloudMonitor agent.
 *
 * @param request PutMonitoringConfigRequest
 * @return PutMonitoringConfigResponse
 */
async function putMonitoringConfig(request: PutMonitoringConfigRequest): PutMonitoringConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return putMonitoringConfigWithOptions(request, runtime);
}

model PutResourceMetricRuleRequest {
  escalations?: {
    critical?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Critical-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Critical'),
    info?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Info-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Info-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Info-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Info'),
    warn?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Warn-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Warn'),
  }(name='Escalations'),
  compositeExpression?: {
    expressionList?: [ 
      {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle', example='GreaterThanOrEqualToThreshold'),
        metricName?: string(name='MetricName', description='The metric that is used to monitor the cloud service.', example='cpu_total'),
        period?: long(name='Period', description='The aggregation period of the metric.

Unit: seconds.', example='60'),
        statistics?: string(name='Statistics', description='The statistical method of the metric. Valid value:

*   $Maximum: the maximum value
*   $Minimum: the minimum value
*   $Average: the average value
*   $Availability: the availability rate (usually used for site monitoring)

>  `$` is the prefix of the metric. For information about the Alibaba Cloud services that are supported by CloudMonitor, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='$Maximum'),
        threshold?: string(name='Threshold', description='The alert threshold.', example='90'),
      }
    ](name='ExpressionList', description='The trigger conditions that are created in standard mode.'),
    expressionListJoin?: string(name='ExpressionListJoin', description='The relationship between the trigger conditions for multiple metrics. Valid value:

*   `&&`: An alert is triggered only if all metrics meet the trigger conditions. An alert is triggered only if the results of all expressions specified in the ExpressionList parameter are `true`.
*   `||`: An alert is triggered if one of the metrics meets the trigger conditions.', example='||'),
    expressionRaw?: string(name='ExpressionRaw', description='The trigger conditions that are created by using expressions. You can use expressions to create trigger conditions in the following scenarios:

*   Set an alert blacklist for specific resources. For example, if you specify `$instanceId != \\\\"i-io8kfvcpp7x5****\\\\" ``&&`` $Average > 50`, no alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 50.
*   Set a special alert threshold for a specified instance in the rule. For example, if you specify `$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)`, an alert is triggered when the `average metric value` of the `i-io8kfvcpp7x5****` instance exceeds 80 or the `average metric value` of other instances exceeds 50.
*   Limit the number of instances whose metric values exceed the threshold. For example, if you specify `count($Average > 20) > 3`, an alert is triggered only when the `average metric value` of more than three instances exceeds 20.', example='$Average > ($instanceId == \\\\"i-io8kfvcpp7x5****\\\\"? 80: 50)'),
    level?: string(name='Level', description='The alert level. Valid values:

*   Critical
*   Warn
*   Info', example='Critical'),
    times?: int32(name='Times', description='The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.', example='3'),
  }(name='CompositeExpression', description='The trigger conditions for multiple metrics.

>  The trigger conditions for a single metric and multiple metrics are mutually exclusive. You cannot specify trigger conditions for a single metric and multiple metrics at the same time.'),
  contactGroups?: string(name='ContactGroups', description='The alert contact groups. Alert notifications are sent to the alert contacts in the alert contact group.

>  An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see [PutContact](https://help.aliyun.com/document_detail/114923.html) and [PutContactGroup](https://help.aliyun.com/document_detail/114929.html).

This parameter is required.', example='ECS_Group'),
  effectiveInterval?: string(name='EffectiveInterval', description='The period of time during which the alert rule is effective.', example='00:00-23:59'),
  emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.'),
  interval?: string(name='Interval', description='The interval at which alerts are triggered based on the alert rule. Unit: seconds.

>  For more information about how to query the statistical periods of metrics, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  labels?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='tagKey1'),
      value?: string(name='Value', description='The tag value.

>  You can use a template parameter to specify a tag value. CloudMonitor replaces the value of the template parameter with an actual tag value.', example='ECS'),
    }
  ](name='Labels', description='If the metric meets the specified condition in the alert rule and CloudMonitor sends an alert notification, the tag is also written to the metric and displayed in the alert notification.

>  This parameter is equivalent to the Label parameter of Prometheus alerts.'),
  metricName?: string(name='MetricName', description='The metric name. For more information about how to query metric names, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to the name of the namespace. For more information about how to query the names of namespaces, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service. For more information about how to query the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to `acs_prometheus`.

This parameter is required.', example='acs_ecs_dashboard'),
  noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid value:

*   KEEP_LAST_STATE (default): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.', example='KEEP_LAST_STATE'),
  noEffectiveInterval?: string(name='NoEffectiveInterval', description='The period of time during which the alert rule is ineffective.', example='00:00-06:00'),
  period?: string(name='Period', description='The statistical period of the metric. Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected.

>  For more information about how to query the statistical periods of metrics, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  prometheus?: {
    annotations?: [ 
      {
        key?: string(name='Key', description='The key of the annotation.', example='summary'),
        value?: string(name='Value', description='The value of the annotation.', example='{{ $labels.instance }} CPU usage above 10% {current value: {{ humanizePercentage $value }} }'),
      }
    ](name='Annotations', description='The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.

>  This parameter is equivalent to the annotations parameter of open source Prometheus.'),
    level?: string(name='Level', description='The alert level. Valid values:

*   Critical
*   Warn
*   Info', example='Critical'),
    promQL?: string(name='PromQL', description='PromQL statements are supported.

>  The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.', example='cpuUsage{instanceId="xxxx"}[1m]>90'),
    times?: int32(name='Times', description='The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.', example='3'),
  }(name='Prometheus', description='Prometheus alerts.

>  This parameter is required only if you create a Prometheus alert rule for Hybrid Cloud Monitoring.'),
  resources?: string(name='Resources', description='The resource information. Examples: `[{"instanceId":"i-uf6j91r34rnwawoo****"}]` and `[{"userId":"100931896542****"}]`.

For more information about the supported dimensions that are used to query resources, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='[{"instanceId":"i-uf6j91r34rnwawoo****"}]'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

You can specify a new ID or the ID of an existing alert rule. For more information about how to query the IDs of alert rules, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new ID, a threshold-triggered alert rule is created.

This parameter is required.', example='a151cd6023eacee2f0978e03863cc1697c89508****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

You can specify a new name or the name of an existing alert rule. For more information about how to query the names of alert rules, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new name, a threshold-triggered alert rule is created.

This parameter is required.', example='test123'),
  silenceTime?: int32(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400.

>  If an alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.', example='86400'),
  webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='https://alert.aliyun.com.com:8080/callback'),
}

model PutResourceMetricRuleShrinkRequest {
  escalations?: {
    critical?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Critical-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Critical-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Critical'),
    info?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Info-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Info-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Info-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Info'),
    warn?: {
        comparisonOperator?: string(name='ComparisonOperator', description='The operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid value:

*   GreaterThanOrEqualToThreshold: greater than or equal to the threshold
*   GreaterThanThreshold: greater than the threshold
*   LessThanOrEqualToThreshold: less than or equal to the threshold
*   LessThanThreshold: less than the threshold
*   NotEqualToThreshold: not equal to the threshold
*   EqualToThreshold: equal to the threshold
*   GreaterThanYesterday: greater than the metric value at the same time yesterday
*   LessThanYesterday: less than the metric value at the same time yesterday
*   GreaterThanLastWeek: greater than the metric value at the same time last week
*   LessThanLastWeek: less than the metric value at the same time last week
*   GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
*   LessThanLastPeriod: less than the metric value in the last monitoring cycle

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='GreaterThanOrEqualToThreshold'),
        statistics?: string(name='Statistics', description='The statistical methods for Warn-level alerts.

The value of this parameter is determined by the `Statistics` column corresponding to the `MetricName` parameter of the specified cloud service. The value of this parameter can be Maximum, Minimum, or Average. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='Average'),
        threshold?: string(name='Threshold', description='The threshold for Warn-level alerts.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='90'),
        times?: int32(name='Times', description='The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.

>  You must select at least one of the Critical, Warn, and Info alert levels and specify the Statistics, ComparisonOperator, Threshold, and Times parameters for each alert level.', example='3'),
    }(name='Warn'),
  }(name='Escalations'),
  compositeExpressionShrink?: string(name='CompositeExpression', description='The trigger conditions for multiple metrics.

>  The trigger conditions for a single metric and multiple metrics are mutually exclusive. You cannot specify trigger conditions for a single metric and multiple metrics at the same time.'),
  contactGroups?: string(name='ContactGroups', description='The alert contact groups. Alert notifications are sent to the alert contacts in the alert contact group.

>  An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see [PutContact](https://help.aliyun.com/document_detail/114923.html) and [PutContactGroup](https://help.aliyun.com/document_detail/114929.html).

This parameter is required.', example='ECS_Group'),
  effectiveInterval?: string(name='EffectiveInterval', description='The period of time during which the alert rule is effective.', example='00:00-23:59'),
  emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.'),
  interval?: string(name='Interval', description='The interval at which alerts are triggered based on the alert rule. Unit: seconds.

>  For more information about how to query the statistical periods of metrics, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  labels?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='tagKey1'),
      value?: string(name='Value', description='The tag value.

>  You can use a template parameter to specify a tag value. CloudMonitor replaces the value of the template parameter with an actual tag value.', example='ECS'),
    }
  ](name='Labels', description='If the metric meets the specified condition in the alert rule and CloudMonitor sends an alert notification, the tag is also written to the metric and displayed in the alert notification.

>  This parameter is equivalent to the Label parameter of Prometheus alerts.'),
  metricName?: string(name='MetricName', description='The metric name. For more information about how to query metric names, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to the name of the namespace. For more information about how to query the names of namespaces, see [DescribeHybridMonitorNamespaceList](https://help.aliyun.com/document_detail/428880.html).

This parameter is required.', example='cpu_total'),
  namespace?: string(name='Namespace', description='The namespace of the cloud service. For more information about how to query the namespaces of cloud services, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

>  If you create a Prometheus alert rule for Hybrid Cloud Monitoring, you must set this parameter to `acs_prometheus`.

This parameter is required.', example='acs_ecs_dashboard'),
  noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid value:

*   KEEP_LAST_STATE (default): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.', example='KEEP_LAST_STATE'),
  noEffectiveInterval?: string(name='NoEffectiveInterval', description='The period of time during which the alert rule is ineffective.', example='00:00-06:00'),
  period?: string(name='Period', description='The statistical period of the metric. Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected.

>  For more information about how to query the statistical periods of metrics, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
  prometheusShrink?: string(name='Prometheus', description='Prometheus alerts.

>  This parameter is required only if you create a Prometheus alert rule for Hybrid Cloud Monitoring.'),
  resources?: string(name='Resources', description='The resource information. Examples: `[{"instanceId":"i-uf6j91r34rnwawoo****"}]` and `[{"userId":"100931896542****"}]`.

For more information about the supported dimensions that are used to query resources, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='[{"instanceId":"i-uf6j91r34rnwawoo****"}]'),
  ruleId?: string(name='RuleId', description='The ID of the alert rule.

You can specify a new ID or the ID of an existing alert rule. For more information about how to query the IDs of alert rules, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new ID, a threshold-triggered alert rule is created.

This parameter is required.', example='a151cd6023eacee2f0978e03863cc1697c89508****'),
  ruleName?: string(name='RuleName', description='The name of the alert rule.

You can specify a new name or the name of an existing alert rule. For more information about how to query the names of alert rules, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new name, a threshold-triggered alert rule is created.

This parameter is required.', example='test123'),
  silenceTime?: int32(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met. Unit: seconds. Default value: 86400.

>  If an alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.', example='86400'),
  webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.', example='https://alert.aliyun.com.com:8080/callback'),
}

model PutResourceMetricRuleResponseBody = {
  code?: string(name='Code', description='The responses code.

>  The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='The request processing has failed due to some unknown error.'),
  requestId?: string(name='RequestId', description='The request ID.', example='65D50468-ECEF-48F1-A6E1-D952E89D9436'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutResourceMetricRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutResourceMetricRuleResponseBody(name='body'),
}

/**
 * @summary Configures an alert rule.
 *
 * @description This topic provides an example on how to create a threshold-triggered alert rule for the `cpu_total` metric of an Elastic Compute Service (ECS) instance whose ID is `i-uf6j91r34rnwawoo****`. The namespace of ECS metrics is `acs_ecs_dashboard`. The alert contact group of the alert rule is `ECS_Group`. The name of the alert rule is `test123`. The ID of the alert rule is `a151cd6023eacee2f0978e03863cc1697c89508****`. The statistical method for Critical-level alerts is `Average`. The comparison operator for Critical-level alerts is `GreaterThanOrEqualToThreshold`. The threshold for Critical-level alerts is `90`. The consecutive number of times for which the metric value meets the trigger condition before a Critical-level alert is triggered is `3`.
 * >  Statistics verification was added on August 15, 2024. Only the statistical value of the corresponding metric can be set for the Statistics parameter. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://www.alibabacloud.com/help/en/cms/support/appendix-1-metrics).
 *
 * @param tmpReq PutResourceMetricRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutResourceMetricRuleResponse
 */
async function putResourceMetricRuleWithOptions(tmpReq: PutResourceMetricRuleRequest, runtime: Util.RuntimeOptions): PutResourceMetricRuleResponse {
  Util.validateModel(tmpReq);
  var request = new PutResourceMetricRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.compositeExpression)) {
    request.compositeExpressionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.compositeExpression, 'CompositeExpression', 'json');
  }
  if (!Util.isUnset(tmpReq.prometheus)) {
    request.prometheusShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.prometheus, 'Prometheus', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.compositeExpressionShrink)) {
    query['CompositeExpression'] = request.compositeExpressionShrink;
  }
  if (!Util.isUnset(request.contactGroups)) {
    query['ContactGroups'] = request.contactGroups;
  }
  if (!Util.isUnset(request.effectiveInterval)) {
    query['EffectiveInterval'] = request.effectiveInterval;
  }
  if (!Util.isUnset(request.emailSubject)) {
    query['EmailSubject'] = request.emailSubject;
  }
  if (!Util.isUnset(request.interval)) {
    query['Interval'] = request.interval;
  }
  if (!Util.isUnset(request.labels)) {
    query['Labels'] = request.labels;
  }
  if (!Util.isUnset(request.metricName)) {
    query['MetricName'] = request.metricName;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.noDataPolicy)) {
    query['NoDataPolicy'] = request.noDataPolicy;
  }
  if (!Util.isUnset(request.noEffectiveInterval)) {
    query['NoEffectiveInterval'] = request.noEffectiveInterval;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.prometheusShrink)) {
    query['Prometheus'] = request.prometheusShrink;
  }
  if (!Util.isUnset(request.resources)) {
    query['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  if (!Util.isUnset(request.ruleName)) {
    query['RuleName'] = request.ruleName;
  }
  if (!Util.isUnset(request.silenceTime)) {
    query['SilenceTime'] = request.silenceTime;
  }
  if (!Util.isUnset(request.webhook)) {
    query['Webhook'] = request.webhook;
  }
  if (!Util.isUnset(request.escalations)) {
    query['Escalations'] = request.escalations;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutResourceMetricRule',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Configures an alert rule.
 *
 * @description This topic provides an example on how to create a threshold-triggered alert rule for the `cpu_total` metric of an Elastic Compute Service (ECS) instance whose ID is `i-uf6j91r34rnwawoo****`. The namespace of ECS metrics is `acs_ecs_dashboard`. The alert contact group of the alert rule is `ECS_Group`. The name of the alert rule is `test123`. The ID of the alert rule is `a151cd6023eacee2f0978e03863cc1697c89508****`. The statistical method for Critical-level alerts is `Average`. The comparison operator for Critical-level alerts is `GreaterThanOrEqualToThreshold`. The threshold for Critical-level alerts is `90`. The consecutive number of times for which the metric value meets the trigger condition before a Critical-level alert is triggered is `3`.
 * >  Statistics verification was added on August 15, 2024. Only the statistical value of the corresponding metric can be set for the Statistics parameter. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://www.alibabacloud.com/help/en/cms/support/appendix-1-metrics).
 *
 * @param request PutResourceMetricRuleRequest
 * @return PutResourceMetricRuleResponse
 */
async function putResourceMetricRule(request: PutResourceMetricRuleRequest): PutResourceMetricRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return putResourceMetricRuleWithOptions(request, runtime);
}

model PutResourceMetricRulesRequest {
  rules?: [ 
    {
      escalations?: {
        critical?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Critical'),
        info?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Info'),
        warn?: {
            comparisonOperator?: string(name='ComparisonOperator'),
            n?: int32(name='N'),
            preCondition?: string(name='PreCondition'),
            statistics?: string(name='Statistics'),
            threshold?: string(name='Threshold'),
            times?: int32(name='Times'),
        }(name='Warn'),
      }(name='Escalations'),
      contactGroups?: string(name='ContactGroups', description='The alert contact groups. The alert notifications are sent to the alert contacts in the alert contact group.

Valid values of N: 1 to 500.

>  An alert contact group can contain one or more alert contacts. For information about how to create alert contacts and alert contact groups, see [PutContact](https://help.aliyun.com/document_detail/114923.html) and [PutContactGroup](https://help.aliyun.com/document_detail/114929.html).

This parameter is required.', example='ECS_Group'),
      effectiveInterval?: string(name='EffectiveInterval', description='The time period during which the alert rule is effective.

Valid values of N: 1 to 500.', example='00:00-23:59'),
      emailSubject?: string(name='EmailSubject', description='The subject of the alert notification email.

Valid values of N: 1 to 500.'),
      interval?: string(name='Interval', description='The interval at which alerts are triggered based on the alert rule.

Unit: seconds.

Valid values of N: 1 to 500.

>  For information about how to query the statistical period of a metric, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
      labels?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='tagKey1'),
          value?: string(name='Value', description='The tag value.

>  You can use a template parameter to specify a tag value. CloudMonitor replaces the value of the template parameter with an actual tag value.', example='ECS'),
        }
      ](name='Labels', description='If the metric meets the specified condition in the alert rule and CloudMonitor sends an alert notification, the tag is also written to the metric and displayed in the alert notification.'),
      metricName?: string(name='MetricName', description='The metric name.

Valid values of N: 1 to 500.

For information about how to query the name of a metric, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='cpu_total'),
      namespace?: string(name='Namespace', description='The namespace of the cloud service.

Valid values of N: 1 to 500.

For information about how to query the namespace of a cloud service, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='acs_ecs_dashboard'),
      noDataPolicy?: string(name='NoDataPolicy', description='The method that is used to handle alerts when no monitoring data is found. Valid values:

*   KEEP_LAST_STATE (default): No operation is performed.
*   INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
*   OK: The status is considered normal.

Valid values of N: 1 to 500.', example='KEEP_LAST_STATE'),
      noEffectiveInterval?: string(name='NoEffectiveInterval', description='The time period during which the alert rule is ineffective.

Valid values of N: 1 to 500.', example='00:00-06:00'),
      period?: string(name='Period', description='The statistical period of the metric.

Unit: seconds. The default value is the interval at which the monitoring data of the metric is collected.

Valid values of N: 1 to 500.

>  For information about how to query the statistical period of a metric, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).', example='60'),
      resources?: string(name='Resources', description='The information about the resource. Example: `[{"instanceId":"i-uf6j91r34rnwawoo****"}]` or `[{"userId":"100931896542****"}]`.

Valid values of N: 1 to 500.

For more information about the supported dimensions that are used to query resources, see [Appendix 1: Metrics](https://help.aliyun.com/document_detail/163515.html).

This parameter is required.', example='[{"instanceId":"i-uf6j91r34rnwawoo****"}]'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.

Valid values of N: 1 to 500.

You can specify a new ID or the ID of an existing alert rule. For information about how to query the ID of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new ID, a threshold-triggered alert rule is created.

This parameter is required.', example='a151cd6023eacee2f0978e03863cc1697c89508****'),
      ruleName?: string(name='RuleName', description='The name of the alert rule.

Valid values of N: 1 to 500.

You can specify a new name or the name of an existing alert rule. For information about how to query the name of an alert rule, see [DescribeMetricRuleList](https://help.aliyun.com/document_detail/114941.html).

>  If you specify a new name, a threshold-triggered alert rule is created.

This parameter is required.', example='test123'),
      silenceTime?: int32(name='SilenceTime', description='The mute period during which new alert notifications are not sent even if the trigger conditions are met.

Unit: seconds. Default value: 86400.

Valid values of N: 1 to 500.

>  If an alert is not cleared after the mute period ends, CloudMonitor resends an alert notification.', example='86400'),
      webhook?: string(name='Webhook', description='The callback URL to which a POST request is sent when an alert is triggered based on the alert rule.

Valid values of N: 1 to 500.', example='https://alert.aliyun.com.com:8080/callback'),
    }
  ](name='Rules', description='The threshold-triggered alert rules.

Valid values of N: 1 to 500.

This parameter is required.'),
}

model PutResourceMetricRulesResponseBody = {
  code?: string(name='Code', description='The response code.

>  The status code 200 indicates that the request was successful.', example='200'),
  failedListResult?: {
    target?: [ 
    {
      result?: {
        code?: string(name='Code', description='The response code.', example='404'),
        message?: string(name='Message', description='The error message returned.', example='The request processing has failed due to some unknown error.'),
        success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='false'),
      }(name='Result', description='The alert rule that failed to be created.'),
      ruleId?: string(name='RuleId', description='The ID of the alert rule.', example='a151cd6023eacee2f0978e03863cc1697c89508****'),
    }
  ](name='Target')
  }(name='FailedListResult', description='The alert rules that failed to be created for the resource.'),
  message?: string(name='Message', description='The error message returned.', example='The request processing has failed due to some unknown error.'),
  requestId?: string(name='RequestId', description='The request ID.', example='15D1440E-BF24-5A41-93E4-36864635179E'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
}

model PutResourceMetricRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PutResourceMetricRulesResponseBody(name='body'),
}

/**
 * @summary Creates multiple alert rules for the specified metric of a specified resource.
 *
 * @description This topic provides an example on how to create a threshold-triggered alert rule for the `cpu_total` metric of an Elastic Compute Service (ECS) instance whose ID is `i-uf6j91r34rnwawoo****`. The namespace of ECS metrics is `acs_ecs_dashboard`. The alert contact group of the alert rule is `ECS_Group`. The name of the alert rule is `test123`. The ID of the alert rule is `a151cd6023eacee2f0978e03863cc1697c89508****`. The statistical method for Critical-level alerts is `Average`. The comparison operator for Critical-level alerts is `GreaterThanOrEqualToThreshold`. The threshold for Critical-level alerts is `90`. The consecutive number of times for which the metric value meets the trigger condition before a Critical-level alert is triggered is `3`.
 * >  Statistics verification was added on August 15, 2024. Only the statistical value of the corresponding metric can be set for the Statistics parameter. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://www.alibabacloud.com/help/en/cms/support/appendix-1-metrics).
 *
 * @param request PutResourceMetricRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PutResourceMetricRulesResponse
 */
async function putResourceMetricRulesWithOptions(request: PutResourceMetricRulesRequest, runtime: Util.RuntimeOptions): PutResourceMetricRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.rules)) {
    query['Rules'] = request.rules;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PutResourceMetricRules',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates multiple alert rules for the specified metric of a specified resource.
 *
 * @description This topic provides an example on how to create a threshold-triggered alert rule for the `cpu_total` metric of an Elastic Compute Service (ECS) instance whose ID is `i-uf6j91r34rnwawoo****`. The namespace of ECS metrics is `acs_ecs_dashboard`. The alert contact group of the alert rule is `ECS_Group`. The name of the alert rule is `test123`. The ID of the alert rule is `a151cd6023eacee2f0978e03863cc1697c89508****`. The statistical method for Critical-level alerts is `Average`. The comparison operator for Critical-level alerts is `GreaterThanOrEqualToThreshold`. The threshold for Critical-level alerts is `90`. The consecutive number of times for which the metric value meets the trigger condition before a Critical-level alert is triggered is `3`.
 * >  Statistics verification was added on August 15, 2024. Only the statistical value of the corresponding metric can be set for the Statistics parameter. For more information about how to obtain the value of this parameter, see [Appendix 1: Metrics](https://www.alibabacloud.com/help/en/cms/support/appendix-1-metrics).
 *
 * @param request PutResourceMetricRulesRequest
 * @return PutResourceMetricRulesResponse
 */
async function putResourceMetricRules(request: PutResourceMetricRulesRequest): PutResourceMetricRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return putResourceMetricRulesWithOptions(request, runtime);
}

model RemoveTagsRequest {
  groupIds?: [ string ](name='GroupIds', description='The IDs of the application groups.

This parameter is required.', example='12345'),
  regionId?: string(name='RegionId'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.

> The tag key (`Tag.N.Key`) and tag value (`Tag.N.Value`) must be specified at the same time.

This parameter is required.', example='Key1'),
      value?: string(name='Value', description='The tag value.

> The tag key (`Tag.N.Key`) and tag value (`Tag.N.Value`) must be specified at the same time.

This parameter is required.', example='Value1'),
    }
  ](name='Tag', description='The tags.

This parameter is required.'),
}

model RemoveTagsResponseBody = {
  code?: string(name='Code', description='The status code.

> The status code 200 indicates that the request was successful.', example='200'),
  message?: string(name='Message', description='The error message.', example='Illegal parameters.'),
  requestId?: string(name='RequestId', description='The request ID.', example='195390D2-69D0-4D9E-81AA-A7F5BC1B91EB'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   true
*   false', example='true'),
  tag?: {
    tags?: [ string ](name='Tags')
  }(name='Tag', description='The deleted tags.'),
}

model RemoveTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveTagsResponseBody(name='body'),
}

/**
 * @summary Deletes tags.
 *
 * @param request RemoveTagsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveTagsResponse
 */
async function removeTagsWithOptions(request: RemoveTagsRequest, runtime: Util.RuntimeOptions): RemoveTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveTags',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes tags.
 *
 * @param request RemoveTagsRequest
 * @return RemoveTagsResponse
 */
async function removeTags(request: RemoveTagsRequest): RemoveTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeTagsWithOptions(request, runtime);
}

model SendDryRunSystemEventRequest {
  eventContent?: string(name='EventContent', description='The content of the system event.

>  The value of this parameter is a JSON object. We recommend that you include the `product`, `resourceId`, and `regionId` fields in the JSON object.', example='{"product":"CloudMonitor","resourceId":"acs:ecs:cn-hongkong:173651113438****:instance/{instanceId}","level":"CRITICAL","instanceName":"instanceName","regionId":"cn-hangzhou","name":"Agent_Status_Stopped","content":{"ipGroup":"0.0.0.0,0.0.0.1","tianjimonVersion":"1.2.11"},"status":"stopped"}'),
  eventName?: string(name='EventName', description='The name of the system event.

>  For more information, see [DescribeSystemEventMetaList](https://help.aliyun.com/document_detail/114972.html).

This parameter is required.', example='Agent_Status_Stopped'),
  groupId?: string(name='GroupId', description='The ID of the application group.', example='123456'),
  product?: string(name='Product', description='The name of the cloud service.

>  For information about the system events supported by Cloud Monitor for Alibaba Cloud services, see [System events](https://help.aliyun.com/document_detail/167388.html).

This parameter is required.', example='ecs'),
  regionId?: string(name='RegionId'),
}

model SendDryRunSystemEventResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='success'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='486029C9-53E1-44B4-85A8-16A571A043FD'),
  success?: string(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model SendDryRunSystemEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendDryRunSystemEventResponseBody(name='body'),
}

/**
 * @description This operation is used to test whether a system event can be triggered as expected. You can call this operation to simulate a system event and check whether an expected response is returned after an alert is triggered by the system event.
 *
 * @param request SendDryRunSystemEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendDryRunSystemEventResponse
 */
async function sendDryRunSystemEventWithOptions(request: SendDryRunSystemEventRequest, runtime: Util.RuntimeOptions): SendDryRunSystemEventResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.eventContent)) {
    query['EventContent'] = request.eventContent;
  }
  if (!Util.isUnset(request.eventName)) {
    query['EventName'] = request.eventName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendDryRunSystemEvent',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description This operation is used to test whether a system event can be triggered as expected. You can call this operation to simulate a system event and check whether an expected response is returned after an alert is triggered by the system event.
 *
 * @param request SendDryRunSystemEventRequest
 * @return SendDryRunSystemEventResponse
 */
async function sendDryRunSystemEvent(request: SendDryRunSystemEventRequest): SendDryRunSystemEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendDryRunSystemEventWithOptions(request, runtime);
}

model UninstallMonitoringAgentRequest {
  instanceId?: string(name='InstanceId', description='The ID of the host.

This parameter is required.', example='host-****'),
  regionId?: string(name='RegionId'),
}

model UninstallMonitoringAgentResponseBody = {
  code?: string(name='Code', description='The HTTP status code.

>  The HTTP status code 200 indicates that the call was successful.', example='200'),
  message?: string(name='Message', description='The returned message.', example='Successfully'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='466902B9-2842-40B0-B796-00FE772B6EF3'),
  success?: boolean(name='Success', description='Indicates whether the call was successful. Valid values:

*   true: The call was successful.
*   false: The call failed.', example='true'),
}

model UninstallMonitoringAgentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UninstallMonitoringAgentResponseBody(name='body'),
}

/**
 * @description >  This API operation is not applicable to ECS instances. To uninstall the agent from an ECS instance, see [Install and uninstall the Cloud Monitor agent](https://help.aliyun.com/document_detail/183482.html).
 *
 * @param request UninstallMonitoringAgentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UninstallMonitoringAgentResponse
 */
async function uninstallMonitoringAgentWithOptions(request: UninstallMonitoringAgentRequest, runtime: Util.RuntimeOptions): UninstallMonitoringAgentResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UninstallMonitoringAgent',
    version = '2019-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @description >  This API operation is not applicable to ECS instances. To uninstall the agent from an ECS instance, see [Install and uninstall the Cloud Monitor agent](https://help.aliyun.com/document_detail/183482.html).
 *
 * @param request UninstallMonitoringAgentRequest
 * @return UninstallMonitoringAgentResponse
 */
async function uninstallMonitoringAgent(request: UninstallMonitoringAgentRequest): UninstallMonitoringAgentResponse {
  var runtime = new Util.RuntimeOptions{};
  return uninstallMonitoringAgentWithOptions(request, runtime);
}

